Single sign on (OIDC)
Geant Argus supports Single Sign On using social-auth-core and social-auth-django
(Python Social Auth). These libraries
make integration with CoreAAI straight forward for authentication of users. However, they only
deal with the first part of the auhtentication/authorization flow, namely authentication when
a user logs in. It does not handle authorization neither does it make sure that the authentication
(and authorization) is still valid for an existing session.
CoreAAI
Geant Argus is registered as an OIDC Client in the CoreAAI platform. When registering, the following authorization grants are required:
authorization_code
refresh_token
Also, the following scopes are required:
Display name
Email address
Groups (Entitlements)
Development
During development, by default OIDC integration is disabled. To start developing with the Core AAI
OIDC integration, set ARGUS_OIDC_DISABLE environment variable to 0 (or unset it completely) in
your cmd.sh. You then also need to set the other ARGUS_OIDC_* environment variables in your
cmd.sh. The values for these variables can be found in LastPass under the Argus OIDC settings.
Choose the “Local” settings.
For development, Geant Argus is registered as a different application with a different
client_id than for production. The reason for this is that the development client_id supports
a redirect uri beginning with http://127.0.0.1:8000 so that it can be used with local
development. In order to log in using the development client_id your oidc user account must be
part of the Sandbox VO group. You can add yourself to this group as part of the login process.
Middleware
By default, once a user has successfully logged in, Python Social Auth does not validate whether
a user is still active in the OIDC provider or if their entitlements have changed. Geant Argus has
middleware in place that periodically checks the CoreAAI platform for these changes:
geant_argus.auth.SocialAuthRefreshMiddleware.
Note
As of May 2025 there is a bug in the CoreAAi platform that prevents the
SocialAuthRefreshMiddleware to obtain a user’s current entitlements for the duration of the
user’s session. Therefore this middleware has been disabled in favor of a different middleware:
geant_argus.auth.SocialAuthLimitSessionAgeMiddleware. This middleware limits the session
lifetime of OIDC users to 24 hours, so that after a user’s authorization has been revoked, it
takes a maximum of 24 hours for the user’s sessions to be evicted from Geant Argus. This session
lifetime was chosen as a compromise between security and usability. It is also possible to delete
a user’s sessions manually through the admin interface, under Sessions
Settings
The following settings are used to setup the SSO configuration.
Setting |
Description |
Location |
|---|---|---|
|
Whether to disable the OIDC authentication backend |
Environment variable |
|
The text to show on the button in the login page |
|
|
The root url of the CoreAAI OIDC service |
Environment variable |
|
The Geant Argus OIDC client ID, see Lastpass |
Environment variable |
|
The Geant Argus OIDC client secret, see Lastpass |
|
|
A list of authorization rules as described in Authorization |
|
|
The OIDC scopes to request with the authentication request, in addition to the default
|
|
|
When a user logs in using OIDC, a pipeline is run to setup the user. See also Python Social Auth: Pipeline |
|
|
Use the user’s email as their username |
|
|
Redirect users back to the login page if an OIDC login errors somehow |
|
|
Optimization to store OIDC data as a JSONField in PostgreSQL |
|
|
Addtional parameters to send with the authentication request |
|