We have our own user member system, which we would like to link with this software.

Are there any bridges, available.. we dont operate openid on our sites.

Any help appreciated.

db = mysql

asked 30 May '11, 18:23

422's gravatar image

422
1112
accept rate: 0%

edited 31 May '11, 04:49

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674


I'm currently hooking OSQA's auth system in to use drupal 6 via mysql (unfinished yet) and found the ldap postings on this site partially useful for getting your head around general authentication. If you're wanting to authenticate when they use the OSQA login page then duplicating and modifying one of the forum_modules/ folders (localauth, facebookauth etc) would be where you could start.

link

answered 01 Jun '11, 04:59

T1ckL35's gravatar image

T1ckL35
1162
accept rate: 20%

Thanks @T1ckL35

We would want to bypass all OSQA login , registration systems. We have our own groundup membership systems, so I am looking at hooks I suppose.

(01 Jun '11, 19:58) 422

Well part one of my work is to be able to register and login through drupal. Once they have done this then they can visit the OSQA site which will check the session information and attempt to verify if the drupal user is logged in (via mysql). If so then OSQA checks to see if there is a forum user. If there is it authenticates and logs in that user but if not it generates one using the drupal user info and then authenticates and logs that user in. Another requirement is to be able to only login via OSQA's login page (no registration) which checks with drupal before authenticating - but I don't think this is what you are after.

So for part one, at a basic level I created a folder in forum/middleware called drupal and added in backend.py which extends RemoteUserBackend, and remote.py which extends RemoteUserMiddleware. backend.py has a custom authenticate() function that is passed a drupal session cookie and then a query on the drupal db is done to verify if that user is currently logged in. As mentioned above it either authenticates or creates the user and authenticates. Additional classes in backend.py for querying the remote drupal db for user and session info are extended from django.db.models.Model (I tried with forum.models.base.BaseModel but had issues). For these to work I had to modify the settings file DATABASES dictionary to use multiple databases - something I believe only django 1.2 upwards allows. In MIDDLEWARE_CLASSES I added forum.middleware.drupal.remote.DrupalUserMiddleware after the AuthenticationMiddleware line.

I can't really post any code as yet as it is an internal project and having never used django/osqa before it is a bit messy. If that changes I'll let you know though :)

link

answered 02 Jun '11, 04:37

T1ckL35's gravatar image

T1ckL35
1162
accept rate: 20%

Hmm we dont touch drupal, I understand the type of bridge you are describing. Im just not sure we would want two way registration or logging in... seems pointless. I cant see how complex this is, because the info required at registration on osqa is quite small, and thus this could easily be bridged with an existing db. My concerns are the remainder of the queries and comunications. Our instance is just to allow logged in users to pose questions and make answers... and comments. However if they arent logged in we can handle that before they even see the Q.A portion of our site, which like you is heavily under wraps whilst in dev. Will keep an eye on any other replies, or your progress. Thanks for the replies.

(02 Jun '11, 06:10) 422
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×32
×23

Asked: 30 May '11, 18:23

Seen: 779 times

Last updated: 02 Jun '11, 06:10

powered by OSQA