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§
Sourcefn get_id_token(&self, audience: &str) -> Result<IdTokenOrRequest, Error>
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.
Sourcefn get_id_token_with_access_token<S>(
&self,
audience: &str,
response: AccessTokenResponse<S>,
) -> Result<IdTokenRequest, Error>
fn get_id_token_with_access_token<S>( &self, audience: &str, response: AccessTokenResponse<S>, ) -> Result<IdTokenRequest, Error>
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.
Sourcefn parse_id_token_response<S>(
&self,
hash: u64,
response: IdTokenResponse<S>,
) -> Result<IdToken, Error>
fn parse_id_token_response<S>( &self, hash: u64, response: IdTokenResponse<S>, ) -> Result<IdToken, Error>
Once a IdTokenResponse
has been received for an id token request, call this method
to deserialize the token.
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.