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?

SocialQA's avatar
265
SocialQA
asked 2013-03-25 19:29:06 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment 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.

Evgeny's avatar
13.2k
Evgeny
answered 2013-03-25 19:41:28 -0600, updated 2013-03-25 19:50:02 -0600
edit flag offensive 0 remove flag delete link

Comments

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

SocialQA's avatar SocialQA (2013-03-25 19:45:08 -0600) edit
1

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

Evgeny's avatar Evgeny (2013-03-25 19:50:28 -0600) edit

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

SocialQA's avatar SocialQA (2013-03-26 23:17:28 -0600) edit
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 (2013-03-27 15:33:38 -0600) edit
add a comment see more comments