def make_facebook_blueprint(
        client_id=None, client_secret=None, scope=None, redirect_url=None,
        redirect_to=None, login_url=None, authorized_url=None,
        session_class=None, backend=None):
    facebook_bp = OAuth2ConsumerBlueprint("facebook", __name__,
        client_id=client_id,
        client_secret=client_secret,
        scope=scope,
        base_url="https://graph.facebook.com/",
        authorization_url="https://www.facebook.com/dialog/oauth",
        token_url="https://graph.facebook.com/oauth/access_token",
        redirect_url=redirect_url,
        redirect_to=redirect_to,
        login_url=login_url,
        authorized_url=authorized_url,
        session_class=session_class,
        backend=backend,
    )
    facebook_bp.from_config["client_id"] = "FACEBOOK_OAUTH_CLIENT_ID"
    facebook_bp.from_config["client_secret"] = "FACEBOOK_OAUTH_CLIENT_SECRET"

    @facebook_bp.before_app_request
    def set_applocal_session():
        ctx = stack.top
        ctx.facebook_oauth = facebook_bp.session

    return facebook_bp
Make a blueprint for authenticating with Facebook using OAuth 2. This requires
dataset/ETHPy150Open singingwolfboy/flask-dance/flask_dance/contrib/facebook.py/make_facebook_blueprint