EPITA backend for python-social-auth
Project description
social-auth-backend-epita
Pluggable authentication backend for python-social-auth
that allows
authentication with the CRI OpenID Connect provider.
Installation instructions
$ pip install social-auth-backend-epita --index-url https://gitlab.cri.epita.fr/api/v4/projects/515/packages/pypi/simple
Configuration instructions
Django
You should take a look at our example project to see how to properly use this package.
- Add
social_auth_backend_epita.backend.EpitaOpenIdConnect
to theAUTHENTICATION_BACKENDS
of your Djangosettings.py
file:
AUTHENTICATION_BACKENDS = (
"social_auth_backend_epita.backend.EpitaOpenIdConnect",
"django.contrib.auth.backends.ModelBackend",
)
- Add your OpenID client credentials to your Django
settings.py
file:
SOCIAL_AUTH_EPITA_KEY = "..."
SOCIAL_AUTH_EPITA_SECRET = "..."
- Fill
SOCIAL_AUTH_EPITA_SCOPE
with the relevant scope names in your Djangosettings.py
file:
SOCIAL_AUTH_EPITA_SCOPE = [
"email",
"epita",
]
Other frameworks
This backend only uses framework-agnostic functions and should work with any framework supported by python-social-auth. Be advised that it has only been tested with Django.
Pipeline functions
You may add the following functions to your social auth pipeline:
social_auth_backend_epita.pipeline.deny_old_users
This function prevents users with an updated username to sign in with their old identity.
social_auth_backend_epita.pipeline.merge_old_users
Merge old accounts into the new one when a username update is detected.
For now it is only possible to merge one old account into a new, not previously existing, account. This is achieved by updating the old account with the new username.
social_auth_backend_epita.pipeline.update_email
This function allows email updates to be processed since the default social-auth pipeline ignores the email claim for existing accounts.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for social-auth-backend-epita-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 934b03f3122b8a82980b41f60514889869dd7d1160ad5dcbeb97ed8e940f18e7 |
|
MD5 | ee89ca87cbdac12b69636747fcb96b52 |
|
BLAKE2b-256 | b9f3d94a66b80d7040f2085cc24b7fbd958f2818d2a39dad2bbe54b76eb187eb |
Hashes for social_auth_backend_epita-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14c7813f79316012e8362a6b56f2e4f146ebd303e1044be56cd869c112b65ac2 |
|
MD5 | 4d7c891d0480cb2abd62b80542ee6b3a |
|
BLAKE2b-256 | 2d552f3a27efc3afdfd650b4dbacba64e57bc6f6d5a0a0ce78ab334596a0e982 |