pub trait IdTokenProvider {
    // Required methods
    fn get_id_token(&self, audience: &str) -> Result<IdTokenOrRequest, Error>;
    fn get_id_token_with_access_token<S>(
        &self,
        audience: &str,
        response: AccessTokenResponse<S>
    ) -> Result<IdTokenRequest, Error>
       where S: AsRef<[u8]>;
    fn parse_id_token_response<S>(
        &self,
        hash: u64,
        response: IdTokenResponse<S>
    ) -> Result<IdToken, Error>
       where S: AsRef<[u8]>;
}
Expand description

A IdTokenProvider supplies all methods needed for all different flows to get a id token.

Required Methods§

source

fn get_id_token(&self, audience: &str) -> Result<IdTokenOrRequest, Error>

Attempts to retrieve an id token that can be used when communicating via IAP etc.

source

fn get_id_token_with_access_token<S>( &self, audience: &str, response: AccessTokenResponse<S> ) -> Result<IdTokenRequest, Error>
where S: AsRef<[u8]>,

Some token sources require a access token to be used to generte a id token. If get_id_token returns a AccessTokenResponse, this method should be called.

source

fn parse_id_token_response<S>( &self, hash: u64, response: IdTokenResponse<S> ) -> Result<IdToken, Error>
where S: AsRef<[u8]>,

Once a IdTokenResponse has been received for an id token request, call this method to deserialize the token.

Object Safety§

This trait is not object safe.

Implementors§