def init_app(app):
    from redash.authentication import (
        google_oauth,
        saml_auth,
        remote_user_auth,
        ldap_auth,
    )

    login_manager.init_app(app)
    login_manager.anonymous_user = models.AnonymousUser
    login_manager.REMEMBER_COOKIE_DURATION = settings.REMEMBER_COOKIE_DURATION

    @app.before_request
    def extend_session():
        session.permanent = True
        app.permanent_session_lifetime = timedelta(seconds=settings.SESSION_EXPIRY_TIME)

    from redash.security import csrf
    for auth in [google_oauth, saml_auth, remote_user_auth, ldap_auth]:
        blueprint = auth.blueprint
        csrf.exempt(blueprint)
        app.register_blueprint(blueprint)

    user_logged_in.connect(log_user_logged_in)
    login_manager.request_loader(request_loader)
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.