pub fn authorize_url<S>(&self, state_fn: S) -> AuthorizationRequest
    where
        S: FnOnce() -> CsrfToken,
    {
        AuthorizationRequest {
            auth_url: &self.auth_url,
            client_id: &self.client_id,
            extra_params: Vec::new(),
            pkce_challenge: None,
            redirect_url: self.redirect_url.as_ref().map(Cow::Borrowed),
            response_type: "code".into(),
            scopes: Vec::new(),
            state: state_fn(),
        }
    }
///
/// Generates an authorization URL for a new authorization request.
///
/// # Arguments
///
/// * `state_fn` - A function that returns an opaque value used by the client to maintain state
///   between the request and callback. The authorization server includes this value when
///   redirecting the user-agent back to the client.
///
/// # Security Warning
///
/// Callers should use a fresh, unpredictable `state` for each authorization request and verify
/// that this value matches the `state` parameter passed by the authorization server to the
/// redirect URI. Doing so mitigates
/// [Cross-Site Request Forgery](https://tools.ietf.org/html/rfc6749#section-10.12)
///  attacks. To disable CSRF protections (NOT recommended), use `insecure::authorize_url`
///  instead.
///
Generates an authorization URL for a new authorization request.
Generates an authorization URL for a new authorization request .
pub fn authorize_url<S>(&self, state_fn: S) -> AuthorizationRequest
    where
        S: FnOnce() -> CsrfToken,
    {
        AuthorizationRequest {
            auth_url: &self.auth_url,
            client_id: &self.client_id,
            extra_params: Vec::new(),
            pkce_challenge: None,
            redirect_url: self.redirect_url.as_ref().map(Cow::Borrowed),
            response_type: "code".into(),
            scopes: Vec::new(),
            state: state_fn(),
        }
    }
pub fn authorize_url < S > ( & self , state_fn : S ) -> AuthorizationRequest where S : FnOnce ( ) -> CsrfToken , { AuthorizationRequest { auth_url : & self . auth_url , client_id : & self . client_id , extra_params : Vec :: new ( ) , pkce_challenge : None , redirect_url : self . redirect_url . as_ref ( ) . map ( Cow :: Borrowed ) , response_type : " " . into ( ) , scopes : Vec :: new ( ) , state : state_fn ( ) , } }
Generates an authorization URL for a new authorization request.
Generates an authorization URL for a new authorization request .
&self
state_fn
S
&self
state_fn
S
security warning
Callers should use a fresh, unpredictable `state` for each authorization request and verify
that this value matches the `state` parameter passed by the authorization server to the
redirect URI. Doing so mitigates
[Cross-Site Request Forgery]
attacks. To disable CSRF protections (NOT recommended), use `insecure::authorize_url`
instead.
Callers should use a fresh unpredictable ` state ` for each authorization request and verify that this value matches the ` state ` parameter passed by the authorization server to the redirect URI . Doing so mitigates [ Cross - Site Request Forgery ] attacks . To disable CSRF protections ( NOT recommended ) use ` insecure :: authorize_url ` instead .