[][src]Trait yup_oauth2::AuthenticatorDelegate

pub trait AuthenticatorDelegate: Clone {
    fn client_error(&mut self, _: &Error) -> Retry { ... }
fn token_storage_failure(&mut self, is_set: bool, _: &dyn Error) -> Retry { ... }
fn request_failure(&mut self, _: RequestError) { ... }
fn token_refresh_failed<S: AsRef<str>>(
        &mut self,
        error: S,
        error_description: &Option<String>
    ) { ... } }

A partially implemented trait to interact with the Authenticator

The only method that needs to be implemented manually is present_user_code(...), as no assumptions are made on how this presentation should happen.

Provided methods

fn client_error(&mut self, _: &Error) -> Retry

Called whenever there is an client, usually if there are network problems.

Return retry information.

fn token_storage_failure(&mut self, is_set: bool, _: &dyn Error) -> Retry

Called whenever we failed to retrieve a token or set a token due to a storage error. You may use it to either ignore the incident or retry. This can be useful if the underlying TokenStorage may fail occasionally. if is_set is true, the failure resulted from TokenStorage.set(...). Otherwise, it was TokenStorage.get(...)

fn request_failure(&mut self, _: RequestError)

The server denied the attempt to obtain a request code

fn token_refresh_failed<S: AsRef<str>>(
    &mut self,
    error: S,
    error_description: &Option<String>
)

Called if we could not acquire a refresh token for a reason possibly specified by the server. This call is made for the delegate's information only.

Loading content...

Implementors

impl AuthenticatorDelegate for DefaultAuthenticatorDelegate[src]

Loading content...