forked from OSQA/osqa
-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an optional authorization function for the OIDC authentication.
* custom oidc auth module allows an optional parameter OIDC_AUTHORIZATION_FUNCTION * askbot/deps/django_authopenid/protocols/__init__.py: - get_protocol: passes the oidc_authorization_function to the OIDC protocol * askbot/deps/django_authopenid/protocols/oidc/protocol.py: - __init__method gets the authorization function and stores it on self - adds method is_user_authorized to check if the user is authorized to access the resource * askbot/deps/django_authopenid/util.py: - LoginMethod: reads the OIDC_AUTHORIZATION_FUNCTION or sets a dummy lambda function returning True the function takes the decoded token as an argument and returns a boolean * askbot/deps/django_authopenid/protocols/oidc/views.py: - complete_oidc_signin: checks if the user is authorized to access the resource by calling the oidc protocols is_user_authorized method allows to continue or return a Bad Request response
- Loading branch information
1 parent
0af5323
commit d2cba17
Showing
4 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters