First time here? Check out the FAQ!
1

Where should I start on adding new authentication module
 

I am trying to add new single sign-on authentication to askbot. Where should I start with? For example, lets say I want add something similar to Google can someone provide the setups to fallow?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
SocialQA's avatar
265
SocialQA
asked 12 years ago

Comments

see more comments

1 Answer

1

If you want to add an authentication method to the Askbot it will be necessary to modify the dictionary "data" in the function get_enabled_major_login_providers in file askbot/deps/django_authopenid/utils.py.

In general, all the authentication code is inside the directory askbot/deps/django_authopenid.

You can also create a plugin and link it via setting ASKBOT_CUSTOM_AUTH_MODEL, but you will have to also read the code to understand how to prepare the plugin as it is not documented at the moment.

If the method you are adding is openid, oauth1 or oauth2 no other changes will be necessary, otherwise you'll have to create the supporting code for the method elsewhere as well - and again you will need to wrap your head around the askbot auth module:).

Alternatively - just use documentation for the Django authentication, disable the askbot auth backend in the settings and replace with your own.

Thirdly, you can add a login backend and modify the template askbot/templates/authopenid/signin.html.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago, updated 12 years ago
link

Comments

does the existing authentication model have to be disable or can both worlds exist at the same time?

SocialQA's avatar SocialQA (12 years ago)
1

Edited, did not think of the other way at first.

Evgeny's avatar Evgeny (12 years ago)

do I need to edit login_providers.py because I start just adding to data dictionary and things break.

SocialQA's avatar SocialQA (12 years ago)
1

I hear you. It is quite normal to have difficulties when you are just getting familiar with a new thing. But I hope you agree that the program did not break by itself:).

Evgeny's avatar Evgeny (12 years ago)
see more comments