def index():
"""Step 1: User Authorization.
Redirect the user/resource owner to the OAuth provider using an URL with a few key OAuth parameters.
"""
mautic = OAuth2Session(client_id, redirect_uri=redirect_uri)
authorization_url, state = mautic.authorization_url(authorization_base_url, grant_type='authorization_code')
session['oauth_state'] = state
return redirect(authorization_url)
# Step 2: User authorization, this happens on the provider.
评论列表
文章目录