OAuth Bundle API

flask_unchained.bundles.oauth

OAuthBundle

The OAuth Bundle.

flask_unchained.bundles.oauth.config

Config

flask_unchained.bundles.oauth.services

OAuthService

flask_unchained.bundles.oauth.views

OAuthController

OAuthBundle

class flask_unchained.bundles.oauth.OAuthBundle[source]

The OAuth Bundle.

name: str = 'oauth_bundle'

The name of the OAuth Bundle.

Config

class flask_unchained.bundles.oauth.config.Config[source]
OAUTH_REMOTE_APP_GITHUB = {'access_token_method': 'POST', 'access_token_url': 'https://github.com/login/oauth/access_token', 'authorize_url': 'https://github.com/login/oauth/authorize', 'base_url': 'https://api.github.com', 'request_token_params': {'scope': 'user:email'}, 'request_token_url': None}
OAUTH_REMOTE_APP_AMAZON = {'access_token_method': 'POST', 'access_token_url': 'https://api.amazon.com/auth/o2/token', 'authorize_url': 'https://www.amazon.com/ap/oa', 'base_url': 'https://api.amazon.com', 'request_token_params': {'scope': 'profile:email'}, 'request_token_url': None}
OAUTH_REMOTE_APP_GITLAB = {'access_token_method': 'POST', 'access_token_url': 'https://gitlab.com/oauth/token', 'authorize_url': 'https://gitlab.com/oauth/authorize', 'base_url': 'https://gitlab.com/api/v4/user', 'request_token_params': {'scope': 'openid read_user'}, 'request_token_url': None}

OAuthService

class flask_unchained.bundles.oauth.OAuthService[source]
get_user_details(provider: flask_oauthlib.client.OAuthRemoteApp) → Tuple[str, dict][source]

For the given provider, return the user’s email address and any extra data to create the user model with.

on_authorized(provider: flask_oauthlib.client.OAuthRemoteApp) → None[source]

Optional callback to add custom behavior upon OAuth authorized.

OAuthController

class flask_unchained.bundles.oauth.OAuthController[source]