Skip to main content

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.

  1. Add social_auth_backend_epita.backend.EpitaOpenIdConnect to the AUTHENTICATION_BACKENDS of your Django settings.py file:
AUTHENTICATION_BACKENDS = (
    "social_auth_backend_epita.backend.EpitaOpenIdConnect",
    "django.contrib.auth.backends.ModelBackend",
)
  1. Add your OpenID client credentials to your Django settings.py file:
SOCIAL_AUTH_EPITA_KEY = "..."
SOCIAL_AUTH_EPITA_SECRET = "..."
  1. Fill SOCIAL_AUTH_EPITA_SCOPE with the relevant scope names in your Django settings.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

social-auth-backend-epita-1.0.2.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

social_auth_backend_epita-1.0.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file social-auth-backend-epita-1.0.2.tar.gz.

File metadata

  • Download URL: social-auth-backend-epita-1.0.2.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.8.5-arch1-1

File hashes

Hashes for social-auth-backend-epita-1.0.2.tar.gz
Algorithm Hash digest
SHA256 934b03f3122b8a82980b41f60514889869dd7d1160ad5dcbeb97ed8e940f18e7
MD5 ee89ca87cbdac12b69636747fcb96b52
BLAKE2b-256 b9f3d94a66b80d7040f2085cc24b7fbd958f2818d2a39dad2bbe54b76eb187eb

See more details on using hashes here.

File details

Details for the file social_auth_backend_epita-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for social_auth_backend_epita-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14c7813f79316012e8362a6b56f2e4f146ebd303e1044be56cd869c112b65ac2
MD5 4d7c891d0480cb2abd62b80542ee6b3a
BLAKE2b-256 2d552f3a27efc3afdfd650b4dbacba64e57bc6f6d5a0a0ce78ab334596a0e982

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page