forked from openfun/ralph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(authentication) add OpenId Connect authentication
Add ID tokens verification issued by a third party authentication server (like Keycloak or Okta). Ralph user can specify in the .env file the authentication method that will be called at each request by setting the variable RALPH_RUNSERVER_AUTH_BACKEND to either `basic` or `oidc`.
- Loading branch information
Showing
20 changed files
with
886 additions
and
202 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Main module for Ralph's LRS API authentication.""" | ||
|
||
from ralph.api.auth.basic import get_authenticated_user as get_basic_user | ||
from ralph.api.auth.oidc import get_authenticated_user as get_oidc_user | ||
from ralph.conf import settings | ||
|
||
# At startup, select the authentication mode that will be used | ||
get_authenticated_user = ( | ||
get_oidc_user | ||
if settings.RUNSERVER_AUTH_BACKEND == settings.AuthBackends.OIDC | ||
else get_basic_user | ||
) |
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
Oops, something went wrong.