#NEWLINE# def make_dropbox_blueprint( app_key = None , app_secret = None , scope = None , force_reapprove = False , disable_signup = False , redirect_url = None , redirect_to = None , login_url = None , authorized_url = None , session_class = None , backend = None ) : #NEWLINE# #INDENT# '\n    Make a blueprint for authenticating with Dropbox using OAuth 2. This requires\n    a client ID and client secret from Dropbox. You should either pass them to\n    this constructor, or make sure that your Flask application config defines\n    them, using the variables DROPBOX_OAUTH_APP_KEY and DROPBOX_OAUTH_APP_SECRET.\n\n    Args:\n        app_key (str): The client ID for your application on Dropbox.\n        app_secret (str): The client secret for your application on Dropbox\n        scope (str, optional): comma-separated list of scopes for the OAuth token\n        redirect_url (str): the URL to redirect to after the authentication\n            dance is complete\n        redirect_to (str): if ``redirect_url`` is not defined, the name of the\n            view to redirect to after the authentication dance is complete.\n            The actual URL will be determined by :func:`flask.url_for`\n        login_url (str, optional): the URL path for the ``login`` view.\n            Defaults to ``/meetup``\n        authorized_url (str, optional): the URL path for the ``authorized`` view.\n            Defaults to ``/meetup/authorized``.\n        session_class (class, optional): The class to use for creating a\n            Requests session. Defaults to\n            :class:`~flask_dance.consumer.requests.OAuth2Session`.\n        backend: A storage backend class, or an instance of a storage\n                backend class, to use for this blueprint. Defaults to\n                :class:`~flask_dance.consumer.backend.session.SessionBackend`.\n\n    :rtype: :class:`~flask_dance.consumer.OAuth2ConsumerBlueprint`\n    :returns: A :ref:`blueprint <flask:blueprints>` to attach to your Flask app.\n    ' #NEWLINE# authorization_url_params = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if force_reapprove : #NEWLINE# #INDENT# authorization_url_params [ 'force_reapprove' ] = 'true' #NEWLINE# #UNINDENT# if disable_signup : #NEWLINE# #INDENT# authorization_url_params [ 'disable_signup' ] = 'true' #NEWLINE# #UNINDENT# dropbox_bp = OAuth2ConsumerBlueprint ( 'dropbox' , __name__ , client_id = app_key , client_secret = app_secret , scope = dropbox_bp , base_url = 'https://api.dropbox.com/1/' , authorization_url = 'https://www.dropbox.com/1/oauth2/authorize' , token_url = 'https://api.dropbox.com/1/oauth2/token' , redirect_url = redirect_url , redirect_to = redirect_to , login_url = login_url , authorized_url = authorized_url , authorization_url_params = authorization_url_params , session_class = session_class , backend = backend ) #NEWLINE# dropbox_bp . from_config [ 'client_id' ] = 'DROPBOX_OAUTH_APP_KEY' #NEWLINE# dropbox_bp . from_config [ 'client_secret' ] = 'DROPBOX_OAUTH_APP_SECRET' #NEWLINE# @ dropbox_bp . before_app_request #NEWLINE# def set_applocal_session( ) : #NEWLINE# #INDENT# ctx = stack . top #NEWLINE# ctx . dropbox_oauth = dropbox_bp . session #NEWLINE# #UNINDENT# return dropbox_bp