Client

Trait Client 

Source
pub trait Client:
    'static
    + Sized
    + Clone
    + Debug {
    type TokenResponse;
    type Configuration: Clone + Debug + PartialEq;
    type LoginState: Debug + Serialize + DeserializeOwned;
    type SessionState: Clone + Debug;

    // Required methods
    fn from_config<'async_trait>(
        config: Self::Configuration,
    ) -> Pin<Box<dyn Future<Output = Result<Self, OAuth2Error>> + 'async_trait>>
       where Self: 'async_trait;
    fn set_redirect_uri(self, url: Url) -> Self;
    fn make_login_context(
        &self,
        config: &InnerConfig,
        redirect_url: Url,
    ) -> Result<LoginContext<Self::LoginState>, OAuth2Error>;
    fn exchange_code<'life0, 'async_trait>(
        &'life0 self,
        code: String,
        login_state: Self::LoginState,
    ) -> Pin<Box<dyn Future<Output = Result<(OAuth2Context, Self::SessionState), OAuth2Error>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn exchange_refresh_token<'life0, 'async_trait>(
        &'life0 self,
        refresh_token: String,
        session_state: Self::SessionState,
    ) -> Pin<Box<dyn Future<Output = Result<(OAuth2Context, Self::SessionState), OAuth2Error>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn logout(
        &self,
        _session_state: Self::SessionState,
        _options: LogoutOptions,
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

fn from_config<'async_trait>( config: Self::Configuration, ) -> Pin<Box<dyn Future<Output = Result<Self, OAuth2Error>> + 'async_trait>>
where Self: 'async_trait,

Source

fn set_redirect_uri(self, url: Url) -> Self

Source

fn make_login_context( &self, config: &InnerConfig, redirect_url: Url, ) -> Result<LoginContext<Self::LoginState>, OAuth2Error>

Source

fn exchange_code<'life0, 'async_trait>( &'life0 self, code: String, login_state: Self::LoginState, ) -> Pin<Box<dyn Future<Output = Result<(OAuth2Context, Self::SessionState), OAuth2Error>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn exchange_refresh_token<'life0, 'async_trait>( &'life0 self, refresh_token: String, session_state: Self::SessionState, ) -> Pin<Box<dyn Future<Output = Result<(OAuth2Context, Self::SessionState), OAuth2Error>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn logout(&self, _session_state: Self::SessionState, _options: LogoutOptions)

Trigger the logout of the session

Clients may choose to contact some back-channel or redirect to a logout URL.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§