Flask-Dance — Flask Dance 5.0.0 documentation

# Flask-Dance

Doing the OAuth dance with style using Flask, requests, and oauthlib. Check out just how easy it can be to hook up your Flask app with OAuth:

    from flask import Flask, redirect, url_for
    from flask_dance.contrib.github import make_github_blueprint, github

    app = Flask(__name__)
    app.secret_key = "supersekrit"  # Replace this with your own secret!
    blueprint = make_github_blueprint(
        client_id="my-key-here",
        client_secret="my-secret-here",
    )
    app.register_blueprint(blueprint, url_prefix="/login")

    @app.route("/")
    def index():
        if not github.authorized:
            return redirect(url_for("github.login"))
        resp = github.get("/user")
        assert resp.ok
        return "You are @{login} on GitHub".format(login=resp.json()["login"])

Ready to get started?

## User Guide

- Installation
- Quickstart
- Concepts
- Understanding the Magic
- Multi-User Setups
- Logging Out
- Projects Using Flask-Dance

## Options & Configuration

- Providers
  - Atlassian
  - Authentiq
  - Azure
  - Digital Ocean
  - Discord
  - Dropbox
  - Facebook
  - Fitbit
  - GitHub
  - GitLab
  - Google
  - Heroku
  - JIRA
  - LinkedIn
  - Meetup
  - Nylas
  - Reddit
  - Salesforce
  - Slack
  - Strava
  - Twitch
  - Twitter
  - Spotify
  - Zoho
  - Custom
- Token Storages
  - Flask Session
  - SQLAlchemy
  - Custom
- Signals

## Advanced Topics

- How OAuth Works
  - Definitions
  - OAuth 2
  - OAuth 1
  - Dance Complete
- Proxies and HTTPS
- Testing Apps That Use Flask-Dance
  - Mock Storages
  - Mock API Responses
  - Provided Pytest Fixture
- Developer Interface
  - Consumers
  - Storages
  - Sessions
- Contributing to Flask-Dance
  - Providers
  - Documentation
  - Code

# Indices and tables

- Index

- Module Index

- Search Page

Fork me on GitHub