Single sign-on for pretalx based on social-auth-app-django
Project description
Single Sign-On (SSO) Plugin for pretalx
This is a plugin for pretalx. It provides an integration with Python Social Auth, allowing users to log in with third-party identity providers.
It is of fork of pretalx-social-auth, which itself is originally based on social_django from the Python Social Auth project, but with the removal of deprecated features and the addition of pretalx-specific settings.
Screenshots
Installation
You can install the plugin from PyPI or directly from GitHub.
# Stable release from PyPI
pip install pretalx-sso
# Pre-release from PyPI
# pip install --pre pretalx-sso
# Pre-release from Git (example tag)
# pip install git+https://github.com/tjarbo/pretalx-social-auth.git@v1.2.0-alpha.1
Configuration
In your pretalx.cfg file, add all the auth backends you need as a comma-separated list. Then, add the backend-specific settings to the [plugin:pretalx_sso] section. You can find the backend name and required settings in the python-social-auth documentation.
Example:
[authentication]
additional_auth_backends=social_core.backends.microsoft.MicrosoftOAuth2,social_core.backends.open_id.OpenIdAuth
[plugin:pretalx_sso]
SOCIAL_AUTH_MICROSOFT_GRAPH_KEY=xxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxx
SOCIAL_AUTH_MICROSOFT_GRAPH_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxx
TRUST_IDP_EMAILS=False
Due to how Social Auth is configured with API keys in settings.py, this doesn't support configuring providers (backends) on a per-event basis. This means particular care should be taken where custom event domains are in use, as some providers require a different API key per domain (or adding valid redirect URLs).
The original author initially evaluated using django-allauth, which supports configuring providers in the database on a per-site basis. However, because it replaces the entire authentication model, it would have been significantly harder to implement as a pretalx plugin.
Email-based Account Linking
When a user attempts to log in via SSO for the first time, the plugin checks if a user with the same email address already exists in the database. The behavior in this situation is controlled by the TRUST_IDP_EMAILS global setting.
TRUST_IDP_EMAILS Setting
This setting controls whether the operator trusts all configured identity providers (IDPs) to authenticate users:
-
Disabled (Default - Secure): Users logging in via SSO for the first time will be rejected if an account with that email already exists. The user will be shown an error message instructing them to log in with their existing credentials first, then connect their social account from their profile settings.
-
Enabled (Trust IDPs): Users logging in via SSO for the first time will be automatically linked to existing accounts with the same email address. This provides a seamless experience when users already have an account and want to use SSO.
Security Considerations
The default is disabled for security reasons:
- It prevents unauthorized access if an attacker compromises an email account and creates a social login with a provider
- It ensures explicit user consent before linking accounts
- It's safer when you cannot fully trust all configured identity providers
Enable this setting only when:
- You fully trust all configured identity providers to properly verify email addresses
- Your IDPs enforce email verification
- You want to prioritize user convenience over strict account separation
Release Model
This project follows a trunk-based development workflow with two persistent branches:
| Branch | Purpose | Release type |
|---|---|---|
main |
All merged work lands here. Every push triggers an automatic pre-release on PyPI. | Pre-release (e.g. 1.2.0-alpha.1) |
release |
Tested, stable code. Every push triggers an automatic stable release on PyPI. | Stable release (e.g. 1.2.0) |
Pre-releases are published to PyPI and can be installed with pip install --pre pretalx-sso. Stable releases are the default when running pip install pretalx-sso.
Version numbers and changelogs are managed automatically by python-semantic-release based on Conventional Commits. Please follow the conventional commit format in your pull request titles.
License
This plugin is licensed under the BSD-3-Clause License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub. Check the CONTRIBUTING guidelines for more information on how to contribute.
Acknowledgements
Thanks a lot to Adam for the original implementation of this plugin, which served as the basis for this fork!
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pretalx_sso-1.0.0.tar.gz.
File metadata
- Download URL: pretalx_sso-1.0.0.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
648429d5ea2baa20f9c1d40599640abf413b4fd0f0bf08ca2f089aa83be0e6eb
|
|
| MD5 |
79a04fb6b3ae0eb649b50814499ecdec
|
|
| BLAKE2b-256 |
abfb0a7aacff3d075b80128a8b45afdf712966e11ca9d3294ae2a8880455387b
|
Provenance
The following attestation bundles were made for pretalx_sso-1.0.0.tar.gz:
Publisher:
cd.yml on tjarbo/pretalx-social-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretalx_sso-1.0.0.tar.gz -
Subject digest:
648429d5ea2baa20f9c1d40599640abf413b4fd0f0bf08ca2f089aa83be0e6eb - Sigstore transparency entry: 2118549665
- Sigstore integration time:
-
Permalink:
tjarbo/pretalx-social-auth@d9d45c875ff424e518ce2a4b174ef85bfefbbb75 -
Branch / Tag:
refs/heads/release - Owner: https://github.com/tjarbo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@d9d45c875ff424e518ce2a4b174ef85bfefbbb75 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pretalx_sso-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pretalx_sso-1.0.0-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4e940f596717ebcaf7cf6458f4a23b90b4dcc796eb97f8bc3c87b0dded6669e
|
|
| MD5 |
625fedff13d67e7c3fd21dc172c0e90c
|
|
| BLAKE2b-256 |
604124fd931bf92478bb7b083443513ad728ee72f4cdd2545712460483ee7eeb
|
Provenance
The following attestation bundles were made for pretalx_sso-1.0.0-py3-none-any.whl:
Publisher:
cd.yml on tjarbo/pretalx-social-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretalx_sso-1.0.0-py3-none-any.whl -
Subject digest:
d4e940f596717ebcaf7cf6458f4a23b90b4dcc796eb97f8bc3c87b0dded6669e - Sigstore transparency entry: 2118549862
- Sigstore integration time:
-
Permalink:
tjarbo/pretalx-social-auth@d9d45c875ff424e518ce2a4b174ef85bfefbbb75 -
Branch / Tag:
refs/heads/release - Owner: https://github.com/tjarbo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@d9d45c875ff424e518ce2a4b174ef85bfefbbb75 -
Trigger Event:
push
-
Statement type: