|
I want to use only one openid provider (one from intranet) and hide the others from the login page. I did this for the old cnprog project but many things had changed since I did it. How can I change this and assure that I will be able to update to newer versions of osqa. Some issues encountered:
|
|
Hey Sorin, if you take a look at forum_modules/openidauth/authentication.py, theres a bunch of classes each one representing a provider. You can just comment the ones you don't want and/or create your own, they are very simple to understand. If you want to disable Twitter and facebook as well, you'll have to disable the respective models in settings_local on DISABLED__MODULES add facebookauth and oauthauth. They are different modules because they are not open id. So we have openidauth for open id, oauthauth for oauth (currently we only use it on twitter) and facebookauth which uses theyr own authentication system, much different from either open id and oauth. If you don't want to allow local account creation/authentication and only use open id, you can disable localauth to. Actually, you gave me an idea, and I should add an easier way to do this somewhere on the next few days. Thanks, it worked but not 100% - check the updated question.
(25 Mar '10, 07:44)
sorin
I think that's good idea if we can easily add openid provider what we want, hope we can have it very soon!
(10 Mar '11, 01:24)
rohou
|
|
Just letting people know that I am advancing on the problem. Direct login now works, managed by an optional constant DIRECT_AUTH_PROVIDER in settings. The id providers now returns the user to the page they were on (it even works when authentication is requested halfway through posting a comment). Soon I hope to have a complete shareable feature. |
|
This is exactly what I wanted to do. My solution: a) Copied openidauth module to intranetauth and ripped everything out except for the code for Google OpenID, and modified the url with the intranet url. b) Disabled modules in settings_local.py
c) Added this change:
However, this creates a problem. Before this change, if a user was reading a question before clicking on "login", the OpenID provider would end up redirecting them to that page after a successful login. After this change, a successful login means the user doesn't return to the page they were reading when they clicked "login", but to the root page of the osqa site. I am also trying to figure out how to have the OpenID provider give back the username and email address associated with the original account, so osqa doesn't prompt the user for it. Has anyone worked on this problem? |
Answer updated (the notifications are fixed and should be updated in the repo soon)
btw, I forgot to mention earlier, that js file is old and not used anymore, I deleted that before, but since me and git don't relate very well, the change didn't propagate to the repo, but I'll try again :-)