### Install Social Auth from Source Source: https://github.com/python-social-auth/social-docs/blob/master/docs/installing.md Alternative installation method by cloning the repository and running the setup script. This is useful for development or when needing the latest code. ```bash cd social-auth- sudo python setup.py install ``` -------------------------------- ### Install social-auth-app-django Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/django.md Install the main package using pip. ```bash $ pip install social-auth-app-django ``` -------------------------------- ### Install social-auth-app-pyramid Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/pyramid.md Install the Pyramid integration package using pip. ```default $ pip install social-auth-app-pyramid ``` -------------------------------- ### Install Flask Storage Backends Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/flask.md Install optional storage backend packages for Flask. ```bash $ pip install social-auth-app-flask-sqlalchemy ``` ```bash $ pip install social-auth-app-flask-mongoengine ``` ```bash $ pip install social-auth-app-flask-peewee ``` -------------------------------- ### Install Social Auth Core with All Extras Source: https://github.com/python-social-auth/social-docs/blob/master/docs/installing.md Install the social-auth-core library with the 'all' extra to include dependencies for all available optional features. ```bash pip install "social-auth-core[all]" ``` -------------------------------- ### Install social-auth-app-cherrypy Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/cherrypy.md Install the CherryPy integration package using pip. ```bash $ pip install social-auth-app-cherrypy ``` -------------------------------- ### Install social-auth-app-django with MongoEngine Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/django.md Install the package with support for MongoEngine ORM. ```bash $ pip install social-auth-app-django-mongoengine ``` -------------------------------- ### Install social-auth-app-webpy Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/webpy.md Install the webpy integration package using pip. ```bash $ pip install social-auth-app-webpy ``` -------------------------------- ### GoogleAppEngineAuth Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/implementation.md An example implementation of a custom authentication backend for Google App Engine. ```APIDOC ## Custom Authentication Backend Example ### Description This section provides an example of a custom authentication backend, `GoogleAppEngineAuth`, which inherits from `BaseAuth` and overrides methods to integrate with Google App Engine's user services. ### Class `GoogleAppEngineAuth` ### Methods Overridden #### `get_user_id(details, response)` - **Purpose**: Retrieves the unique user ID from the Google App Engine user object. - **Implementation**: Uses `users.get_current_user()` to get the user and returns their `user_id()` if available. #### `get_user_details(response)` - **Purpose**: Extracts basic user details (ID and email) from the Google App Engine user object. - **Implementation**: Retrieves the current user and returns a dictionary containing 'username' (from user ID) and 'email'. #### `auth_url()` - **Purpose**: Generates the authentication URL for Google App Engine login. - **Implementation**: Uses `users.create_login_url()` with the redirect URI. #### `auth_complete(*args, **kwargs)` - **Purpose**: Completes the authentication process. - **Implementation**: Checks if a user is logged in; if not, raises an `AuthException`. Otherwise, it prepares arguments for `strategy.authenticate`. ### Example Code ```python from google.appengine.api import users from social_core.backends.base import BaseAuth from social_core.exceptions import AuthException class GoogleAppEngineAuth(BaseAuth): """GoogleAppengine authentication backend""" name = 'google-appengine' def get_user_id(self, details, response): """Return current user id.""" user = users.get_current_user() if user: return user.user_id() def get_user_details(self, response): """Return user basic information (id and email only).""" user = users.get_current_user() return {'username': user.user_id(), 'email': user.email(), 'fullname': '', 'first_name': '', 'last_name': ''} def auth_url(self): """Build and return complete URL.""" return users.create_login_url(self.redirect_uri) def auth_complete(self, *args, **kwargs): """Completes login process, must return user instance.""" if not users.get_current_user(): raise AuthException('Authentication error') kwargs.update({'response': '', 'backend': self}) return self.strategy.authenticate(*args, **kwargs) ``` ``` -------------------------------- ### Install Social Auth Core with SAML Extra Source: https://github.com/python-social-auth/social-docs/blob/master/docs/installing.md Install the social-auth-core library with the 'saml' extra to include dependencies required for SAML support. ```bash pip install "social-auth-core[saml]" ``` -------------------------------- ### Install Social Auth Core with Extras Source: https://context7.com/python-social-auth/social-docs/llms.txt Install the core library with optional extras for specific features like SAML, Azure AD, Google One Tap, or all available extras. ```bash pip install "social-auth-core[saml]" ``` ```bash pip install "social-auth-core[azuread]" ``` ```bash pip install "social-auth-core[google-onetap]" ``` ```bash pip install "social-auth-core[all]" ``` -------------------------------- ### Install and Run Tox Source: https://github.com/python-social-auth/social-docs/blob/master/docs/tests.md Install tox if not already present and then run the tox command to test compatibility across supported Python versions. ```bash pip install tox # if not present tox ``` -------------------------------- ### Install Flask Core Package Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/flask.md Install the main Flask application package using pip. ```bash $ pip install social-auth-app-flask ``` -------------------------------- ### Install Shopify Python Library Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/shopify.md Use pip to install the Shopify API Python library. This is a prerequisite for using the Shopify backend. ```bash pip install --upgrade ShopifyAPI ``` -------------------------------- ### Install a Social Auth Component Source: https://github.com/python-social-auth/social-docs/blob/master/docs/installing.md Use this command to install a specific component of the social-auth library. Replace '' with the desired component name (e.g., 'core', 'app-django'). ```bash pip install social-auth- ``` -------------------------------- ### Install Social Auth for Flask with SQLAlchemy Source: https://context7.com/python-social-auth/social-docs/llms.txt Install the Flask package along with the SQLAlchemy storage backend for Flask applications. ```bash pip install social-auth-app-flask ``` ```bash pip install social-auth-app-flask-sqlalchemy ``` -------------------------------- ### Install Social Auth for Django Source: https://context7.com/python-social-auth/social-docs/llms.txt Install the Django-specific package for integrating Python Social Auth into Django projects. ```bash pip install social-auth-app-django ``` -------------------------------- ### Example OAuth Extra Data Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/oauth.md An example of how to configure the extra data settings for the Facebook OAuth backend. Settings must be a list of tuples. ```python SOCIAL_AUTH_FACEBOOK_EXTRA_DATA = [(..., ...)] ``` -------------------------------- ### Kubernetes Projected Service Account Token Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/azuread.md Example Kubernetes Pod configuration demonstrating how to mount a service account token as a projected volume, making it available as an environment variable for Azure Workload Identity. ```yaml apiVersion: v1 kind: Pod metadata: name: mypod spec: serviceAccountName: myserviceaccount containers: - name: mycontainer image: myimage env: - name: AZURE_FEDERATED_TOKEN_FILE value: /var/run/secrets/azure/tokens/azure-identity-token volumeMounts: - name: azure-identity-token mountPath: /var/run/secrets/azure/tokens readOnly: true volumes: - name: azure-identity-token projected: sources: - serviceAccountToken: path: azure-identity-token audience: api://AzureADTokenExchange expirationSeconds: 3600 ``` -------------------------------- ### Pipeline Customization Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/developer_intro.md Implement custom logic within a pipeline step. This example shows how to conditionally execute code only for a specific backend. ```python def my_custom_step(strategy, backend, request, details, *args, **kwargs): if backend.name != 'my_custom_backend': return # otherwise, do the special steps for your custom backend ``` -------------------------------- ### SAML Organization Information Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Define organization details for SAML, including a display name for users. Ensure English is specified at a minimum. ```python { "en-US": { "name": "example", "displayname": "Example Inc.", "url": "http://example.com", } } ``` -------------------------------- ### Implement Get Setting Method Source: https://github.com/python-social-auth/social-docs/blob/master/docs/strategies.md Subclasses must implement this method to retrieve the value for a given setting name. ```python def get_setting(self, name): """Return value for given setting name""" raise NotImplementedError('Implement in subclass') ``` -------------------------------- ### Install SAML Dependency and Resolve Library Mismatches Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Install system dependencies and Python packages from source to avoid lxml & xmlsec library version mismatches. This is necessary when encountering errors related to libxml2 versions. ```sh # Install system dependencies sudo apt install libxmlsec1-dev # Install Python packages from the source pip install --no-binary lxml --no-binary xmlsec -e 'social-core[saml]' ``` -------------------------------- ### Implement Custom Google App Engine Auth Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/implementation.md This example shows how to create a custom authentication backend for Google App Engine by extending the BaseAuth class and overriding necessary methods. ```python from google.appengine.api import users from social_core.backends.base import BaseAuth from social_core.exceptions import AuthException class GoogleAppEngineAuth(BaseAuth): """GoogleAppengine authentication backend""" name = 'google-appengine' def get_user_id(self, details, response): """Return current user id.""" user = users.get_current_user() if user: return user.user_id() def get_user_details(self, response): """Return user basic information (id and email only).""" user = users.get_current_user() return {'username': user.user_id(), 'email': user.email(), 'fullname': '', 'first_name': '', 'last_name': ''} def auth_url(self): """Build and return complete URL.""" return users.create_login_url(self.redirect_uri) def auth_complete(self, *args, **kwargs): """Completes login process, must return user instance.""" if not users.get_current_user(): raise AuthException('Authentication error') kwargs.update({'response': '', 'backend': self}) return self.strategy.authenticate(*args, **kwargs) ``` -------------------------------- ### VK.com OAuth2 Application API Request Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/vk.md Example of the first API request to be specified in VK.com application settings for OAuth2 authentication. ```text method=getProfiles&uids={viewer_id}&format=json&v=5.53&fields=id,first_name,last_name,screen_name,photo ``` -------------------------------- ### Example Custom Login Function Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/cherrypy.md An example of a custom login function that sets the user ID in the session. This function should be imported and referenced by SOCIAL_AUTH_LOGIN_METHOD. ```python def login_user(strategy, user): strategy.session_set('user_id', user.id) ``` -------------------------------- ### Salesforce Sandbox Login URL Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/salesforce.md This template tag generates the URL for initiating the Salesforce sandbox OAuth2 login flow. ```django {% url social:begin 'salesforce-oauth2-sandbox' %} ``` -------------------------------- ### Example Admin User Search Fields Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/django.md Provide a list of user model fields like 'username', 'first_name', or 'email' for the Django admin search. ```python SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['username', 'first_name', 'email'] ``` -------------------------------- ### Twilio Login Link Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/twilio.md An HTML anchor tag to initiate the Twilio login process. This link should be placed in your application's templates. ```html Enter using Twilio ``` -------------------------------- ### Resume Pipeline with Partial Token Source: https://github.com/python-social-auth/social-docs/blob/master/docs/pipeline.md Example of a partial pipeline function that redirects the user to a form, including the partial token in the URL. The user is then redirected back to `/complete//` to resume the pipeline. ```default from urllib.parse import urlencode @partial def my_partial_function(strategy, backend, current_partial=None, **kwargs): # Check if user needs to provide additional information if not kwargs.get('phone_number'): # Include partial_token in the URL params = urlencode({'partial_token': current_partial.token}) url = f'/my-form/?{params}' return redirect(url) ``` -------------------------------- ### Create SAML Login Link in Django Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Example of creating a login URL for a specific SAML IdP in a Django view and template. The 'idp' query parameter specifies the Identity Provider to use. ```python # In view: context['testshib_url'] = u"{base}?{params}".format( base=reverse('social:begin', kwargs={'backend': 'saml'}), params=urllib.urlencode({'next': '/home', 'idp': 'testshib'}) ) # In template: TestShib Login # Result: TestShib Login ``` -------------------------------- ### Start Social Auth Login URL Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/porting_from_dsa.md Use this namespaced URL in templates to initiate the social authentication process for a specific provider. ```default {% url 'social:begin' "google-oauth2" %} ``` -------------------------------- ### SAML Support Contact Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Specify contact details for the support contact of the SAML application. This includes their given name and email address. ```python { "givenName": "Support Guy", "emailAddress": "support@example.com", } ``` -------------------------------- ### Configure SAML SP Extra Settings Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Set custom parameters for the underlying python-saml library's SP configuration using SOCIAL_AUTH_SAML_SP_EXTRA. This example shows how to publish a rollover certificate. ```python { "x509certNew": "MIIEDjCCAvagAwIBAgIBADA ... 8Bbnl+ev0peYzxFyF5sQA==", } ``` -------------------------------- ### LoginRadius HTML Widget Setup Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/loginradius.md Include this HTML and JavaScript in your template to trigger the LoginRadius authentication process. Ensure the `LOGINRADIUS_KEY` and `LOGINRADIUS_REDIRECT_URL` are available in the template context. ```default
``` -------------------------------- ### Bungie Social Auth Pipeline Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/bungie.md Customize the authentication pipeline for Bungie. This example shows the default pipeline with comments explaining each step. You can modify this to include custom steps or alter existing ones. ```python SOCIAL_AUTH_PIPELINE = ( # Get the information we can about the user and return it in a simple # format to create the user instance later. On some cases the details are # already part of the auth response from the provider, but sometimes this # could hit a provider API. 'social_core.pipeline.social_auth.social_details', # Get the social uid from whichever service we're authing thru. The uid is # the unique identifier of the given user in the provider. 'social_core.pipeline.social_auth.social_uid', # Verifies that the current auth process is valid within the current # project, this is where emails and domains whitelists are applied (if # defined). # Super'ed in bungie.py 'social_core.pipeline.social_auth.auth_allowed', # Checks if the current social-account is already associated in the site. 'social_core.pipeline.social_auth.social_user', # Make up a username for this person, appends a random string at the end if # there's any collision. 'social_core.pipeline.user.get_username', # Redirect to an @partial view to get missing user information here. # If you wish to validate or associate by email, this is required. # '.pipeline.required_user_information', # Send a validation email to the user to verify its email address. # Disabled by default. # 'social_core.pipeline.mail.mail_validation', # Associates the current social details with another user account with # a similar email address. Disabled by default. # 'social_core.pipeline.social_auth.associate_by_email', # Create a user account if we haven't found one yet. 'social_core.pipeline.user.create_user', # Create the record that associates the social account with the user. 'social_core.pipeline.social_auth.associate_user', # Populate the extra_data field in the social record with the values # specified by settings (and the default ones like access_token, etc). 'social_core.pipeline.social_auth.load_extra_data', # Update the user record with any changed info from the auth service. 'social_core.pipeline.user.user_details', ) ``` -------------------------------- ### Flask App Configuration for Social Auth Source: https://context7.com/python-social-auth/social-docs/llms.txt Basic Flask application setup including secret key and SQLAlchemy database URI for social authentication. ```python # app.py from flask import Flask, g from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, current_user app = Flask(__name__) app.config['SECRET_KEY'] = 'your-secret-key' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db' ``` -------------------------------- ### Enable QQ Authentication Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/qq.md Add the QQ authentication backend to your project's settings to enable its use. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.qq.QQOauth2', ... ) ``` -------------------------------- ### Implement GitHub OAuth2 Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/implementation.md Example of a custom OAuth2 backend for GitHub. Requires defining URLs, access token method, scope separator, and extra data fields. The get_user_details and user_data methods are overridden to process user information specific to GitHub. ```python from social_core.backends.oauth import BaseOAuth2 class GitHubOAuth2(BaseOAuth2): """GitHub OAuth authentication backend""" name = 'github' AUTHORIZATION_URL = 'https://github.com/login/oauth/authorize' ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token' ACCESS_TOKEN_METHOD = 'POST' SCOPE_SEPARATOR = ',' EXTRA_DATA = [ ('id', 'id'), ('expires', 'expires') ] def get_user_details(self, response): """Return user details from GitHub account""" return {'username': response.get('login'), 'email': response.get('email') or '', 'first_name': response.get('name')} def user_data(self, access_token, *args, **kwargs): """Loads user data from service""" url = 'https://api.github.com/user?' + urlencode({ 'access_token': access_token }) return self.get_json(url) ``` -------------------------------- ### Configure Launchpad Authentication Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/launchpad.md Add the LaunchpadOpenId backend to your Django settings to enable authentication through Ubuntu Launchpad. Ensure this is part of your SOCIAL_AUTH_AUTHENTICATION_BACKENDS tuple. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.launchpad.LaunchpadOpenId', ... ) ``` -------------------------------- ### Enable Battle.net Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/battlenet.md Add the Battle.net OAuth2 backend to your project's authentication backends list. Ensure it's correctly placed within the tuple. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.battlenet.BattleNetOAuth2', ... ) ``` -------------------------------- ### Configure Live Connect Extra Permissions Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/live.md Optionally define extra permissions for Live Connect integration. Defaults include 'wl.basic' and 'wl.emails'. 'wl.emails' is required to retrieve user email addresses. ```python SOCIAL_AUTH_LIVE_SCOPE = [...] ``` -------------------------------- ### Fetching OIDC Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/nfdi.md Illustrates how the OIDC configuration is automatically fetched from the provider's endpoint. Ensure the `` is correctly set. ```default /.well-known/openid-configuration ``` -------------------------------- ### Custom User Loading Function Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/pipeline.md An example of a custom pipeline function that loads or identifies a user based on external ID before the 'social_user' step. It returns a dictionary with the 'user' key, which can be a new or existing User instance. ```python def load_user(strategy, backend, uid, user=None, **kwargs): if user: return {'user': user} # Load user from your custom authentication system user = MyUserModel.get_by_external_id(uid) return {'user': user} ``` -------------------------------- ### Google OAuth2 Backend in Template Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/django.md Example of how to link to the Google OAuth2 authentication URL within a Django template. ```html Google ``` -------------------------------- ### Configure Just Giving API Keys Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/justgiving.md Set your Just Giving application key and secret in the project settings. ```python SOCIAL_AUTH_JUSTGIVING_KEY = '' SOCIAL_AUTH_JUSTGIVING_SECRET = '' ``` -------------------------------- ### Facebook Extra Auth Arguments Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/settings.md Provide extra GET parameters for the Facebook authentication process, such as requesting re-authentication. ```python SOCIAL_AUTH_FACEBOOK_AUTH_EXTRA_ARGUMENTS = {'auth_type': 'reauthenticate'} ``` -------------------------------- ### Configure Spotify Authentication Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/spotify.md Add the Spotify OAuth2 backend to your project's authentication backends list. Ensure this is correctly placed within your settings. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.spotify.SpotifyOAuth2', ... ) ``` -------------------------------- ### Implement Session Get Method Source: https://github.com/python-social-auth/social-docs/blob/master/docs/strategies.md Subclasses must implement this method to retrieve a session value for a given key. ```python def session_get(self, name): """Return session value for given key""" raise NotImplementedError('Implement in subclass') ``` -------------------------------- ### Configuring Authentication Backends Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/settings.md Register the authentication backends you intend to use. This list specifies which social providers the application will support. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( 'social_core.backends.open_id.OpenIdAuth', 'social_core.backends.google.GoogleOpenId', 'social_core.backends.google.GoogleOAuth2', 'social_core.backends.google.GoogleOAuth', 'social_core.backends.twitter.TwitterOAuth', 'social_core.backends.yahoo.YahooOpenId', ... ) ``` -------------------------------- ### Configure Login and Logged-in Functions Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/pyramid.md Specify the import paths for the functions that handle user login and check login status. These functions manage user sessions and authentication. ```default SOCIAL_AUTH_LOGIN_FUNCTION = 'example.auth.login_user' SOCIAL_AUTH_LOGGEDIN_FUNCTION = 'example.auth.login_required' ``` -------------------------------- ### Store Custom Fields in Session Source: https://github.com/python-social-auth/social-docs/blob/master/docs/developer_intro.md Configure which custom fields should be stored in the session for communication between views and the pipeline. 'local_password' is an example. ```python SOCIAL_AUTH_FIELDS_STORED_IN_SESSION = ['local_password',] ``` -------------------------------- ### Implement Request Data Method Source: https://github.com/python-social-auth/social-docs/blob/master/docs/strategies.md Subclasses must implement this method to return current request data (POST or GET). ```python def request_data(self): """Return current request data (POST or GET)""" raise NotImplementedError('Implement in subclass') ``` -------------------------------- ### Custom Backend Implementation Source: https://github.com/python-social-auth/social-docs/blob/master/docs/developer_intro.md Subclass an existing backend to create a custom one, like for Intuit's OpenID. Override the 'name' attribute and add it to AUTHENTICATION_BACKENDS. ```python from social_core.backends.open_id import OpenIDAuth class IntuitOpenID(OpenIDAuth): name = 'intuit' ``` -------------------------------- ### Request Additional Scopes Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/vault.md Add custom scopes to the default 'openid', 'profile', and 'email' scopes. This example adds the 'groups' scope. ```python SOCIAL_AUTH_VAULT_SCOPE = ['groups'] ``` -------------------------------- ### Configure Google+ Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/google.md Add the Google+ authentication backend and provide your application's client ID and secret. ```python AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.google.GooglePlusAuth', ) SOCIAL_AUTH_GOOGLE_PLUS_KEY = '...' SOCIAL_AUTH_GOOGLE_PLUS_SECRET = '...' ``` -------------------------------- ### OIDC Redirect URI Setup Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/oidc.md The Redirect URI (Callback URL) to register with your OIDC Identity Provider. For development, localhost can be used. ```default https://your-domain.com/complete/oidc/ ``` -------------------------------- ### Initialize MongoEngine Models Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/flask.md Initialize the social auth models for MongoEngine, passing the Flask app and session. ```python from social_flask_mongoengine.models import init_social init_social(app, session) ``` -------------------------------- ### Configure DailyMotion Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/dailymotion.md Set the DailyMotion application's Client ID and Client Secret in your project settings. Ensure these are kept confidential. ```python SOCIAL_AUTH_DAILYMOTION_KEY = '' SOCIAL_AUTH_DAILYMOTION_SECRET = '' ``` -------------------------------- ### Enable Pinterest Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/pinterest.md Add the Pinterest OAuth2 backend to your project's authentication backends list to enable its use. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.pinterest.PinterestOAuth2', ... ) ``` -------------------------------- ### Configure Google OAuth2 Backend Source: https://context7.com/python-social-auth/social-docs/llms.txt Set up the Google OAuth2 backend for authentication. This involves defining authentication backends, providing client ID and secret, requesting specific scopes, and configuring options like account selection and offline access. ```python # settings.py AUTHENTICATION_BACKENDS = [ 'social_core.backends.google.GoogleOAuth2', 'django.contrib.auth.backends.ModelBackend', ] SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = 'your-client-id.apps.googleusercontent.com' SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'your-client-secret' # Request specific scopes SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = [ 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'openid', ] # Allow user to select Google account SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = { 'prompt': 'select_account' } # Get refresh token for offline access SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = { 'access_type': 'offline', 'prompt': 'consent' } # Use unique Google Profile ID instead of email SOCIAL_AUTH_GOOGLE_OAUTH2_USE_UNIQUE_USER_ID = True # Restrict to specific domain (G Suite/Workspace) SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS = ['yourcompany.com'] ``` ```html Sign in with Google ``` -------------------------------- ### Configure Apple ID Settings Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/apple.md Set your Apple ID credentials and desired scopes in your project settings. Ensure the private key is correctly formatted. ```python SOCIAL_AUTH_APPLE_ID_CLIENT = '...' # Your client_id com.application.your, aka "Service ID" SOCIAL_AUTH_APPLE_ID_TEAM = '...' # Your Team ID, ie K2232113 SOCIAL_AUTH_APPLE_ID_KEY = '...' # Your Key ID, ie Y2P99J3N81K SOCIAL_AUTH_APPLE_ID_SECRET = """ -----BEGIN PRIVATE KEY----- MIGTAgE..... -----END PRIVATE KEY-----""" SOCIAL_AUTH_APPLE_ID_SCOPE = ['email', 'name'] SOCIAL_AUTH_APPLE_ID_EMAIL_AS_USERNAME = True # If you want to use email as username ``` -------------------------------- ### Salesforce Login URL Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/salesforce.md Use this template tag in your Django templates to generate the URL for initiating the Salesforce OAuth2 login flow. ```django {% url social:begin 'salesforce-oauth2' %} ``` -------------------------------- ### Django Migration Command Source: https://context7.com/python-social-auth/social-docs/llms.txt Run Django migrations to create the necessary database tables for social authentication. ```bash python manage.py migrate ``` -------------------------------- ### Fedora OIDC Basic Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/fedora.md Provide your client ID and client secret obtained from Fedora's developer portal. These are required for authentication. ```default SOCIAL_AUTH_FEDORA_OIDC_KEY = '' SOCIAL_AUTH_FEDORA_OIDC_SECRET = '' ``` -------------------------------- ### SAML Technical Contact Example Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Provide contact information for the technical contact responsible for the SAML application. Include their given name and email address. ```python { "givenName": "Tech Gal", "emailAddress": "technical@example.com" } ``` -------------------------------- ### Signup by OAuth Access Token (Django) Source: https://github.com/python-social-auth/social-docs/blob/master/docs/use_cases.md Create a view that generates necessary database entries for python-social-auth using a provided access token. This is useful for mobile applications using SDKs for signup. ```python from django.contrib.auth import login from social_django.utils import psa # Define an URL entry to point to this view, call it passing the # access_token parameter like ?access_token=. The URL entry must # contain the backend, like this: # # url(r'^register-by-token/(?P[^/]+)/$ ``` -------------------------------- ### Django Form for Email Input Source: https://github.com/python-social-auth/social-docs/blob/master/docs/pipeline.md A Django template form example for collecting user email. The form should be submitted via POST to the social:complete URL. ```django
{% csrf_token %}
``` -------------------------------- ### Mobile App Authentication Request Source: https://context7.com/python-social-auth/social-docs/llms.txt Example cURL command to authenticate a mobile app with a backend using an access token. Shows the expected JSON response. ```bash # Mobile app authenticates with backend curl -X POST "https://yourapp.com/api/auth/google-oauth2/?access_token=ya29.xxx" # Response { "success": true, "user_id": 123, "username": "john_doe", "email": "john@example.com" } ``` -------------------------------- ### Configure Belgium EID Authentication Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/belgium_eid.md Add 'social_core.backends.belgiumeid.BelgiumEIDOpenId' to your AUTHENTICATION_BACKENDS setting to enable Belgium EID OpenID authentication. Ensure other backends are also listed if used. ```default SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.belgiumeid.BelgiumEIDOpenId', ... ) ``` -------------------------------- ### Requesting Additional Scopes Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/cas.md Request additional claims beyond the default 'openid', 'profile', and 'email' scopes by adding them to the scope list. For example, to request 'groups'. ```python SOCIAL_AUTH_CAS_SCOPE = ['groups'] ``` -------------------------------- ### Configure PKCE Code Challenge Method Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/etsy.md Set the PKCE code challenge method. Only 'S256' is supported and is the default value. ```python SOCIAL_AUTH_ETSY_OAUTH2_PKCE_CODE_CHALLENGE_METHOD = '...' ``` -------------------------------- ### Allowed Redirect Hosts Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/settings.md Specify a list of domains to allow redirection to when SOCIAL_AUTH_SANITIZE_REDIRECTS is True. If the 'next' GET argument's hostname is in this list, redirection is permitted. ```python SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS = ['foo', 'bar'] ``` -------------------------------- ### Configure Google OAuth2 Prompt for Account Selection Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/google.md Add the 'prompt' parameter with the 'select_account' value to allow users to choose which Google account to use for authentication. ```default SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {'prompt': 'select_account'} ``` -------------------------------- ### Enable Apple ID Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/apple.md Add the Apple ID authentication backend to your project's authentication backends list. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.apple.AppleIdAuth', ... ) ``` -------------------------------- ### Custom SAML Attribute Name Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Use this configuration when your IdP provides SAML attributes with different names than the default. For example, map 'attr_first_name' to 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname'. ```python "attr_first_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", ``` -------------------------------- ### Store Extra Parameters in Session Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/settings.md Define parameters from POST or GET requests to be stored in the session. This is useful for maintaining state across redirects, like the 'next' parameter. ```python SOCIAL_AUTH_FIELDS_STORED_IN_SESSION = ['foo',] ``` -------------------------------- ### Enable Zotero Authentication Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/zotero.md Add the Zotero OAuth backend to your project's authentication backends to enable Zotero login. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.zotero.ZoteroOAuth', ... ) ``` -------------------------------- ### Enable NationBuilder Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/nationbuilder.md Add the NationBuilder OAuth2 backend to your project's authentication backends. ```python AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.nationbuilder.NationBuilderOAuth2' ... ``` -------------------------------- ### Disconnection Pipeline Configuration Source: https://context7.com/python-social-auth/social-docs/llms.txt Configure the pipeline for user disconnection from social accounts. Includes steps for checking permissions, getting entries, revoking tokens, and removing associations. ```python # settings.py SOCIAL_AUTH_DISCONNECT_PIPELINE = ( # Check if disconnection is allowed 'social_core.pipeline.disconnect.allowed_to_disconnect', # Get social auth entries to disconnect 'social_core.pipeline.disconnect.get_entries', # Revoke access tokens at provider 'social_core.pipeline.disconnect.revoke_tokens', # Remove social auth association 'social_core.pipeline.disconnect.disconnect', ) # Revoke tokens on disconnect (disabled by default) SOCIAL_AUTH_REVOKE_TOKENS_ON_DISCONNECT = True ``` -------------------------------- ### Add Discogs Backend to Settings Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/discogs.md Include the Discogs OAuth1 backend in your project's authentication backends list. This enables Discogs as a login option. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... "social_core.backends.discogs.DiscogsOAuth1", ... ) ``` -------------------------------- ### Configure LinkedIn OAuth2 Extra Data Storage Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/linkedin.md Map requested LinkedIn fields to UserSocialAuth.extra_data fields. This example includes emailAddress, and defaults like id, firstName, and lastName. ```python # Add email to requested authorizations. SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['r_liteprofile', 'r_emailaddress'] # Add the fields so they will be requested from linkedin. SOCIAL_AUTH_LINKEDIN_OAUTH2_FIELD_SELECTORS = ['emailAddress'] # Arrange to add the fields to UserSocialAuth.extra_data SOCIAL_AUTH_LINKEDIN_OAUTH2_EXTRA_DATA = [('id', 'id'), ('firstName', 'first_name'), ('lastName', 'last_name'), ('emailAddress', 'email_address')] ``` -------------------------------- ### Initialize Social Auth Models Source: https://context7.com/python-social-auth/social-docs/llms.txt Initialize the social authentication models using Flask-SQLAlchemy. ```python from social_flask_sqlalchemy.models import init_social init_social(app, db.session) ``` -------------------------------- ### Generic Extra Auth Arguments for Backends Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/settings.md Define extra GET parameters for any OAuth2 backend's authentication process using the format SOCIAL_AUTH__AUTH_EXTRA_ARGUMENTS. ```python SOCIAL_AUTH__AUTH_EXTRA_ARGUMENTS = {...} ``` -------------------------------- ### Azure AD B2C Tenant Policy Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/azuread.md Set the B2C policy, which should start with 'b2c_'. Refer to Azure AD B2C documentation for details on user flows and custom policies. ```python SOCIAL_AUTH_AZUREAD_B2C_OAUTH2_POLICY = '' ``` -------------------------------- ### Configure Gitea API URL Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/gitea.md If your Gitea instance is hosted on a custom domain, specify the full URL to your Gitea setup. This is required for the authentication flow to correctly communicate with your Gitea instance. ```default SOCIAL_AUTH_GITEA_API_URL = 'https://example.com' ``` -------------------------------- ### Configure Multiple SAML IdP Certificates Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Use x509certMulti["signing"] in SOCIAL_AUTH_SAML_ENABLED_IDPS to provide multiple signing certificates for IdP certificate rotation. ```python SOCIAL_AUTH_SAML_ENABLED_IDPS = { "my_idp": { "entity_id": "https://...", "url": "https://...", "x509certMulti": { "signing": [ # Old certificate """ -----BEGIN CERTIFICATE----- MIIEDjCCAvagAwIBAgIBADA ... -----END CERTIFICATE----- """, # New certificate """ -----BEGIN CERTIFICATE----- 8Bbnl+ev0peYzxFyF5sQA ... -----END CERTIFICATE----- " ] } } } ``` -------------------------------- ### Configure DailyMotion Callback URL Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/dailymotion.md Specify the callback URL for DailyMotion authentication. This URL must match the one registered in the DailyMotion Developer Portal. ```python http:///complete/dailymotion/ ``` -------------------------------- ### Configure Live Connect Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/live.md Set the Client ID and Client Secret obtained from the Live Connect Developer Center in your application's settings. ```python SOCIAL_AUTH_LIVE_KEY = '' SOCIAL_AUTH_LIVE_SECRET = '' ``` -------------------------------- ### Fetch Provider API Data with Access Token Source: https://context7.com/python-social-auth/social-docs/llms.txt Example Django views to fetch user data from Google+ and GitHub APIs using stored access tokens. Ensure the user is logged in. ```python # Example: Fetch Google+ friends import requests from django.contrib.auth.decorators import login_required @login_required def get_google_profile(request): social = request.user.social_auth.get(provider='google-oauth2') access_token = social.extra_data['access_token'] response = requests.get( 'https://www.googleapis.com/oauth2/v1/userinfo', params={'access_token': access_token} ) return response.json() @login_required def get_github_repos(request): social = request.user.social_auth.get(provider='github') access_token = social.extra_data['access_token'] response = requests.get( 'https://api.github.com/user/repos', headers={ 'Authorization': f'Bearer {access_token}', 'Accept': 'application/vnd.github.v3+json' } ) return response.json() ``` -------------------------------- ### Initialize SQLAlchemy Models Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/flask.md Initialize the social auth models for SQLAlchemy, passing the Flask app and database session. ```python from social_flask_sqlalchemy.models import init_social init_social(app, session) ``` -------------------------------- ### Specify PKCE Challenge Method Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/bitbucket_datacenter_oauth2.md Configure the PKCE challenge method, which can be either 's256' or 'plain'. The default method is 's256'. Refer to RFC7636 for more details on PKCE. ```python SOCIAL_AUTH_BITBUCKET_DATACENTER_OAUTH2_PKCE_CODE_CHALLENGE_METHOD = '...' ``` -------------------------------- ### Request Fitbit OAuth 2.0 Scopes Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/fitbit.md Define the list of permissions (scopes) to request from the user during the OAuth 2.0 authentication flow. By default, only 'profile' is requested. This example requests all available scopes. ```python SOCIAL_AUTH_FITBIT_SCOPE = [ 'activity', 'heartrate', 'location', 'nutrition', 'profile', 'settings', 'sleep', 'social', 'weight' ] ``` -------------------------------- ### Register by Access Token Source: https://github.com/python-social-auth/social-docs/blob/master/docs/use_cases.md This view handles authentication using an access token provided via GET parameters. It's typically called via AJAX and can be extended to return user information. ```python from social_django.utils import psa @psa('social:complete') def register_by_access_token(request, backend): # This view expects an access_token GET parameter, if it's needed, # request.backend and request.strategy will be loaded with the current # backend and strategy. token = request.GET.get('access_token') user = request.backend.do_auth(token) if user: login(request, user) return 'OK' else: return 'ERROR' ``` -------------------------------- ### Configure Line.me API Keys Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/line.md Set your Line.me application ID and secret in your project's settings to enable authentication. ```default SOCIAL_AUTH_LINE_KEY = '...' SOCIAL_AUTH_LINE_SECRET = '...' ``` -------------------------------- ### OpenID Custom Username Key Setting Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/openid.md Specify a custom key for retrieving the username from an OpenID provider's response. This setting is provider-specific. For example, to use 'nickname' for Fedora, set SOCIAL_AUTH_FEDORA_USERNAME_KEY to 'nickname'. ```default SOCIAL_AUTH_FEDORA_USERNAME_KEY = 'nickname' ``` -------------------------------- ### Add Appsfuel Live Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/appsfuel.md Include the Appsfuel live backend in your AUTHENTICATION_BACKENDS to enable live authentication. This allows users to log in using their Appsfuel live credentials. ```python AUTHENTICATION_BACKENDS = [ 'social_core.backends.contrib.appsfuel.AppsfuelBackend', ] ``` -------------------------------- ### Configure Vimeo Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/vimeo.md Set your Vimeo application's Client ID and Client Secret in your project settings. ```python SOCIAL_AUTH_VIMEO_KEY = '' SOCIAL_AUTH_VIMEO_SECRET = '' ``` -------------------------------- ### Require Email Partial Pipeline Function Source: https://github.com/python-social-auth/social-docs/blob/master/docs/pipeline.md Example of a partial pipeline function that requires the user's email. It interrupts the pipeline if the email is not provided and renders an HTML form. The form should POST to `/complete//`. ```default from social_core.pipeline.partial import partial @partial def require_email(strategy, backend, details, user=None, **kwargs): if user and user.email: # User already has email, continue return # Check if email was submitted in this request email = strategy.request_data().get('email') if email: # Email was provided, pass it forward return {'details': {'email': email}} # No email yet - interrupt pipeline and show form return strategy.render_html('email_form.html') ``` -------------------------------- ### Custom SAML Attribute Mapping Configuration Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/saml.md Configure SAML attribute mappings, such as 'attr_first_name', to match attributes provided by your Identity Provider. This example shows how to map 'first_name' to a specific URN. Remove unused mappings if the IdP does not provide them. ```python SOCIAL_AUTH_SAML_ENABLED_IDPS = { "gsuite": { "entity_id": "...", "url": "...", "x509cert": "...", "attr_user_permanent_id": "email", "attr_username": "email", "attr_email": "email", # Remove attr_first_name and attr_last_name if not provided by IdP } } ``` -------------------------------- ### Enable Microsoft Graph Backend Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/microsoftgraph.md Add the Microsoft Graph authentication backend to your project's settings to enable its use. ```python SOCIAL_AUTH_AUTHENTICATION_BACKENDS = ( ... 'social_core.backends.microsoft.MicrosoftOAuth2', ... ) ``` -------------------------------- ### Update Authentication Backend in Django Sessions Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/porting_from_dsa.md This script iterates through Django sessions and updates the '_auth_user_backend' field if it starts with 'social_auth', replacing it with a new import path defined in the BACKENDS dictionary. This is useful for migrating old session data to new backend import paths. ```python from django.contrib.sessions.models import Session BACKENDS = { 'social_auth.backends.facebook.FacebookBackend': 'social_core.backends.facebook.FacebookOAuth2' } for sess in Session.objects.iterator(): session_dict = sess.get_decoded() if '_auth_user_backend' in session_dict.keys(): # Change old backend import path from new backend import path if session_dict['_auth_user_backend'].startswith('social_auth'): session_dict['_auth_user_backend'] = BACKENDS[session_dict['_auth_user_backend']] new_sess = Session.objects.save(sess.session_key, session_dict, sess.expire_date) print('New session saved {}'.format(new_sess.pk)) ``` -------------------------------- ### Implement Build Absolute URI Method Source: https://github.com/python-social-auth/social-docs/blob/master/docs/strategies.md Subclasses must implement this method to build an absolute URI with an optional path. ```python def build_absolute_uri(self, path=None): """Build absolute URI with given (optional) path""" raise NotImplementedError('Implement in subclass') ``` -------------------------------- ### Configure Steam API Key Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/steam.md Set your Steam API key obtained from the Steam Dev website in your project settings. ```python SOCIAL_AUTH_STEAM_API_KEY = '...' ``` -------------------------------- ### Configure login and logout redirect URLs Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/django.md Define LOGIN_URL, LOGIN_REDIRECT_URL, and LOGOUT_REDIRECT_URL in settings.py to control user redirection after login and logout. ```python LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = '/' LOGOUT_REDIRECT_URL = '/' ``` -------------------------------- ### Configure Douban OAuth2 Settings Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/douban.md Set up your Douban OAuth2 application credentials. These are required for OAuth2 authentication. ```python SOCIAL_AUTH_DOUBAN_OAUTH2_KEY = '' SOCIAL_AUTH_DOUBAN_OAUTH2_SECRET = '' ``` -------------------------------- ### Configure Battle.net OAuth2 Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/battlenet.md Set your Battle.net application's App ID and Secret in your project settings. These are required for authentication. ```python SOCIAL_AUTH_BATTLENET_OAUTH2_KEY = '...' SOCIAL_AUTH_BATTLENET_OAUTH2_SECRET = '...' ``` -------------------------------- ### Configure Flat API Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/flat.md Set your Flat API Client ID and Client Secret in your project settings to authenticate with the Flat.io API. ```python SOCIAL_AUTH_FLAT_KEY = '' ``` ```python SOCIAL_AUTH_FLAT_SECRET = '' ``` -------------------------------- ### Configure Osso OAuth Client Settings Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/osso.md Set SOCIAL_AUTH_OSSO_KEY for your Client ID, SOCIAL_AUTH_OSSO_SECRET for your Client Secret, and SOCIAL_AUTH_OSSO_BASE_URL for your Osso instance's base URL. ```python SOCIAL_AUTH_OSSO_KEY = os.getenv('SOCIAL_AUTH_OSSO_KEY') SOCIAL_AUTH_OSSO_SECRET = os.getenv('SOCIAL_AUTH_OSSO_SECRET') SOCIAL_AUTH_OSSO_BASE_URL = 'https://demo.ossoapp.com' ``` -------------------------------- ### Configure Datagouvfr API Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/udata.md Set your Datagouvfr Consumer Key and Consumer Secret in your application's settings. Ensure these are kept secure. ```python SOCIAL_AUTH_DATAGOUVFR_KEY = '' SOCIAL_AUTH_DATAGOUVFR_SECRET = '' ``` -------------------------------- ### Add Quizlet Backend to AUTHENTICATION_SETTINGS Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/quizlet.md Include the Quizlet OAuth2 backend in your Django settings to enable authentication. ```python AUTHENTICATION_SETTINGS = ( ... 'social_core.backends.quizlet.QuizletOAuth2', ... ) ``` -------------------------------- ### Configure Kick Client ID and Secret Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/kick.md Set your Kick application's Client ID and Client Secret in your project settings. Ensure these are kept confidential. ```python SOCIAL_AUTH_KICK_KEY = '' SOCIAL_AUTH_KICK_SECRET = '' ``` -------------------------------- ### Configure ChangeTip API Credentials Source: https://github.com/python-social-auth/social-docs/blob/master/docs/backends/changetip.md Set your ChangeTip application's Client ID and Client Secret in your project settings. Ensure these are kept secure. ```python SOCIAL_AUTH_CHANGETIP_KEY = '' SOCIAL_AUTH_CHANGETIP_SECRET = '' ``` -------------------------------- ### Add 'social_django_mongoengine' to INSTALLED_APPS (MongoEngine) Source: https://github.com/python-social-auth/social-docs/blob/master/docs/configuration/porting_from_dsa.md For projects using MongoEngine, add 'social_django_mongoengine' to your INSTALLED_APPS. ```default INSTALLED_APPS = ( ... 'social_django_mongoengine', ... ) ```