[][src]Trait rocket_oauth2::Adapter

pub trait Adapter: Send + Sync + 'static {
    fn authorization_uri(
        &self,
        config: &OAuthConfig,
        state: &str,
        scopes: &[&str]
    ) -> Result<Absolute<'static>, Error>;
fn exchange_code(
        &self,
        config: &OAuthConfig,
        token: TokenRequest
    ) -> Result<TokenResponse<()>, Error>; }

An OAuth2 Adapater can be implemented by any type that facilitates the Authorization Code Grant as described in RFC 6749 §4.1. The implementing type must be able to generate an authorization URI and perform the token exchange.

Required methods

fn authorization_uri(
    &self,
    config: &OAuthConfig,
    state: &str,
    scopes: &[&str]
) -> Result<Absolute<'static>, Error>

Generate an authorization URI as described by RFC 6749 §4.1.1 given configuration, state, and scopes.

fn exchange_code(
    &self,
    config: &OAuthConfig,
    token: TokenRequest
) -> Result<TokenResponse<()>, Error>

Perform the token exchange in accordance with RFC 6749 §4.1.3 given the authorization code provided by the service.

Loading content...

Implementors

impl Adapter for HyperSyncRustlsAdapter[src]

Loading content...