Skip to main content

Flask Social Login is a Python package that simplifies the integration of social login functionality into Flask web applications. With support for popular social authentication providers like Google, GitHub, and Discord, Flask Social Login streamlines the authentication process for users and enables seamless access to your web application.

Project description

Flask Social OAuth

Flask Social OAuth is a Python package that simplifies the integration of social oauth functionality into Flask web applications. With support for popular social authentication providers like Google, GitHub, and Discord, Flask Social OAuth streamlines the authentication process for users and enables seamless access to your web application.

Installation

You can install Flask Social OAuth via pip:

pip install flask-social-oauth

Quick Start

from flask import Flask, session
from flask_social_oauth import Config, initialize_social_login

app = Flask(__name__)
app.secret_key = 'your_secret_key'

# Configure social authentication providers
config = Config()
config.google_auth(
    google_auth_client_id="your_client_id",
    google_auth_client_secret="your_client_secret"
)
config.github_auth(
    github_auth_client_id="your_client_id",
    github_auth_client_secret="your_client_secret"
)
config.discord_auth(
    discord_auth_client_id="your_client_id",
    discord_auth_client_secret="your_client_secret"
)

# Initialize social login
initialize_social_login(session, app, config)

if __name__ == '__main__':
    app.run(debug=True)

Supported Providers

  • Google
  • GitHub
  • Discord

Detailed Description

Config Class

The Config class is used to define the configuration settings for Flask Social Login package. It provides methods to configure authentication parameters for different social providers.

Methods

  • google_auth(): Configures Google authentication parameters.
  • github_auth(): Configures GitHub authentication parameters.
  • discord_auth(): Configures Discord authentication parameters.

initialize_social_login Function

The initialize_social_login() function is used to initialize social login for the Flask app using the provided configuration settings. It registers URL routes and handlers for social authentication providers.

Parameters

  • session: The Flask session object.
  • app: The Flask app instance.
  • config: The configuration settings for Flask Social Login package.

Google Handlers

google_login_handler()

Handles the initiation of the Google OAuth login flow.

Parameters

  • config: The configuration settings for Flask Social Login package.

google_callback_handler()

Handles the Google OAuth callback flow.

Parameters

  • config: The configuration settings for Flask Social Login package.
  • session: The Flask session object.

GitHub Handlers

github_login_handler()

Handles the initiation of the GitHub OAuth login flow.

Parameters

  • config: The configuration settings for Flask Social Login package.

github_callback_handler()

Handles the GitHub OAuth callback flow.

Parameters

  • config: The configuration settings for Flask Social Login package.
  • session: The Flask session object.

Discord Handlers

discord_login_handler()

Handles the initiation of the Discord OAuth login flow.

Parameters

  • config: The configuration settings for Flask Social Login package.

discord_callback_handler()

Handles the Discord OAuth callback flow.

Parameters

  • config: The configuration settings for Flask Social Login package.
  • session: The Flask session object.

Documentation

For more detailed usage and configuration, please refer to the documentation.

Issues and Contributions

If you encounter any issues or have suggestions for improvements, feel free to open an issue on GitHub. Contributions are also welcome!

License

Flask Social OAuth is released under the MIT License.

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

flask_social_oauth-1.2.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

flask_social_oauth-1.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file flask_social_oauth-1.2.0.tar.gz.

File metadata

  • Download URL: flask_social_oauth-1.2.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for flask_social_oauth-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b1848b84706b00eb0fb9fbe6972e6c222b600f9491c63b85bcddb618b1cfb6df
MD5 87f3355a30c683658644d46931cba275
BLAKE2b-256 edf4d96d06558f3b79745d8517df41567d983c1cc53cf0931a06aea532652d67

See more details on using hashes here.

File details

Details for the file flask_social_oauth-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_social_oauth-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4ca960fcac25ba9e07bc1e88a1ecaa5f7a43fb6da0794a406c2fe7dbf231df2
MD5 27cb5b5ac5d51359fac725a34dcfdb5f
BLAKE2b-256 3af105c4cdb06b2b53f6ff92490452bbd589256fd41c53b9b7f3642a597ce678

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