pub struct Client { /* private fields */ }
Expand description
§Client instance
Implementations§
Source§impl Client
impl Client
Sourcepub fn get_other_fields(&self) -> &HashMap<String, Value>
pub fn get_other_fields(&self) -> &HashMap<String, Value>
Gets the extra fields in client
Source§impl Client
Implementation for Client Read Methods
impl Client
Implementation for Client Read Methods
Sourcepub async fn from_uri_async<T>(
http_client: &T,
registration_client_uri: &str,
issuer: &Issuer,
registration_access_token: Option<String>,
jwks: Option<Jwks>,
client_options: Option<ClientOptions>,
fapi: Option<Fapi>,
) -> OidcReturnType<Self>where
T: OidcHttpClient,
pub async fn from_uri_async<T>(
http_client: &T,
registration_client_uri: &str,
issuer: &Issuer,
registration_access_token: Option<String>,
jwks: Option<Jwks>,
client_options: Option<ClientOptions>,
fapi: Option<Fapi>,
) -> OidcReturnType<Self>where
T: OidcHttpClient,
§Creates a client from the Client Read Endpoint
Creates a Client from the Client read endpoint.
http_client
- The http client to make the requestregistration_client_uri
- The client read endpointissuer
- Issuerregistration_access_token
- The access token to be sent with the requestjwks
- Private Jwks of the clientclient_options
- The ClientOptionsfapi
- Fapi version.
Source§impl Client
Implementations for Dynamic Client Registration
impl Client
Implementations for Dynamic Client Registration
Sourcepub async fn register_async<T>(
http_client: &T,
issuer: &Issuer,
client_metadata: ClientMetadata,
register_options: Option<ClientRegistrationOptions>,
fapi: Option<Fapi>,
) -> OidcReturnType<Self>where
T: OidcHttpClient,
pub async fn register_async<T>(
http_client: &T,
issuer: &Issuer,
client_metadata: ClientMetadata,
register_options: Option<ClientRegistrationOptions>,
fapi: Option<Fapi>,
) -> OidcReturnType<Self>where
T: OidcHttpClient,
§Dynamic Client Registration
Attempts a Dynamic Client Registration using the Issuer’s registration_endpoint
http_client
- The http client to make the requestissuer
- The Issuer client should be registered to.client_metadata
- The ClientMetadata to be sent using the registration request.register_options
- ClientRegistrationOptionsfapi
- Fapi version.
Sourcepub fn metadata(&self) -> ClientMetadata
pub fn metadata(&self) -> ClientMetadata
§Get Client Metadata
Gets the ClientMetadata of this Client instance
Source§impl Client
Implementation for Client
impl Client
Implementation for Client
§Authorization Url
Builds an authorization url with respect to the parameters
parameters
- AuthorizationParameters : Customize the authorization request
Sourcepub fn end_session_url(
&self,
parameters: EndSessionParameters,
) -> OidcReturnType<Url>
pub fn end_session_url( &self, parameters: EndSessionParameters, ) -> OidcReturnType<Url>
§End Session Url
Builds an endsession url with respect to the parameters
parameters
- EndSessionParameters : Customize the endsession url
§Authorization Post
Builds an authorization post page with respect to the parameters
parameters
- AuthorizationParameters : Customize the authorization request
Sourcepub fn grant_async<'life0, 'life_self, 'async_recursion, T>(
&'life_self mut self,
http_client: &'life0 T,
params: GrantParams<'async_recursion>,
) -> Pin<Box<dyn Future<Output = OidcReturnType<TokenSet>> + 'async_recursion>>where
T: OidcHttpClient + 'async_recursion,
'life0: 'async_recursion,
'life_self: 'async_recursion,
pub fn grant_async<'life0, 'life_self, 'async_recursion, T>(
&'life_self mut self,
http_client: &'life0 T,
params: GrantParams<'async_recursion>,
) -> Pin<Box<dyn Future<Output = OidcReturnType<TokenSet>> + 'async_recursion>>where
T: OidcHttpClient + 'async_recursion,
'life0: 'async_recursion,
'life_self: 'async_recursion,
§Token Grant
Performs a grant at the token endpoint
http_client
- The http client to make the requestparams
- Token grant params
Sourcepub async fn oauth_callback_async<T>(
&mut self,
http_client: &T,
params: OAuthCallbackParams<'_>,
) -> OidcReturnType<TokenSet>where
T: OidcHttpClient,
pub async fn oauth_callback_async<T>(
&mut self,
http_client: &T,
params: OAuthCallbackParams<'_>,
) -> OidcReturnType<TokenSet>where
T: OidcHttpClient,
§OAuth Callback
Performs the callback for Authorization Server’s authorization response.
http_client
- The http client to make the requestparams
- OAuth callback params
Sourcepub fn set_skip_max_age_check(&mut self, max_age_check: bool)
pub fn set_skip_max_age_check(&mut self, max_age_check: bool)
§Skip Max Age Check
When skip_max_age_check
is set to true, Id Token’s
Max age wont be validated
Sourcepub fn set_skip_nonce_check(&mut self, nonce_check: bool)
pub fn set_skip_nonce_check(&mut self, nonce_check: bool)
§Skip Nonce Check
When skip_nonce_check
is set to true, Id token’s
Nonce wont be validated
Sourcepub fn set_clock_skew_duration(&mut self, duration: Duration)
pub fn set_clock_skew_duration(&mut self, duration: Duration)
§Set Clock Skew
It is possible the RP or OP environment has a system clock skew, which can result in the error “JWT not active yet”.
Sourcepub async fn callback_async<T>(
&mut self,
http_client: &T,
params: OpenIdCallbackParams<'_>,
) -> OidcReturnType<TokenSet>where
T: OidcHttpClient,
pub async fn callback_async<T>(
&mut self,
http_client: &T,
params: OpenIdCallbackParams<'_>,
) -> OidcReturnType<TokenSet>where
T: OidcHttpClient,
§Callback
Performs the callback for Authorization Server’s authorization response.
http_cliet
- The http client to make requestparams
- OpenId callback params
Sourcepub async fn introspect_async<T>(
&mut self,
http_client: &T,
token: String,
token_type_hint: Option<String>,
extras: Option<IntrospectionExtras>,
) -> OidcReturnType<HttpResponse>where
T: OidcHttpClient,
pub async fn introspect_async<T>(
&mut self,
http_client: &T,
token: String,
token_type_hint: Option<String>,
extras: Option<IntrospectionExtras>,
) -> OidcReturnType<HttpResponse>where
T: OidcHttpClient,
§Introspect
Performs an introspection request at Issuer::introspection_endpoint
http_client
: The http client to make the requesttoken
: The token to introspecttoken_type_hint
: Type of the token passed intoken
. Usuallyaccess_token
orrefresh_token
extras
: See IntrospectionExtras
Sourcepub fn request_resource_async<'life0, 'life_self, 'async_recursion, T>(
&'life_self mut self,
http_client: &'life0 T,
params: RequestResourceParams<'async_recursion>,
) -> Pin<Box<dyn Future<Output = OidcReturnType<HttpResponse>> + 'async_recursion>>where
T: OidcHttpClient + 'async_recursion,
'life0: 'async_recursion,
'life_self: 'async_recursion,
pub fn request_resource_async<'life0, 'life_self, 'async_recursion, T>(
&'life_self mut self,
http_client: &'life0 T,
params: RequestResourceParams<'async_recursion>,
) -> Pin<Box<dyn Future<Output = OidcReturnType<HttpResponse>> + 'async_recursion>>where
T: OidcHttpClient + 'async_recursion,
'life0: 'async_recursion,
'life_self: 'async_recursion,
§Request Resource
Performs a request to fetch using the access token at resource_url
.
http_client
: The http client to make the requestparams
: RequestResourceParams
Sourcepub fn callback_params(
&self,
incoming_url: Option<&Url>,
incoming_body: Option<String>,
) -> OidcReturnType<CallbackParams>
pub fn callback_params( &self, incoming_url: Option<&Url>, incoming_body: Option<String>, ) -> OidcReturnType<CallbackParams>
§Callback Params
Tries to convert the Url or a body string to CallbackParams
incoming_url
: The full url of the request (Url). Use this param if the request is of the type GETincoming_body
: Incoming body. Use this param if the request is of the type POST
Only one of the above parameter is parsed.
Sourcepub async fn refresh_async<T>(
&mut self,
http_client: &T,
token_set: TokenSet,
extras: Option<RefreshTokenExtras<'_>>,
) -> OidcReturnType<TokenSet>where
T: OidcHttpClient,
pub async fn refresh_async<T>(
&mut self,
http_client: &T,
token_set: TokenSet,
extras: Option<RefreshTokenExtras<'_>>,
) -> OidcReturnType<TokenSet>where
T: OidcHttpClient,
§Refresh Request
Performs a Token Refresh request at Issuer’s token_endpoint
http_client
: The http client to make the requesttoken_set
: TokenSet with refresh token that will be used to perform the requestextras
: See RefreshTokenExtras
Sourcepub async fn revoke_async<T>(
&mut self,
http_client: &T,
token: &str,
token_type_hint: Option<&str>,
extras: Option<RevokeExtras>,
) -> OidcReturnType<HttpResponse>where
T: OidcHttpClient,
pub async fn revoke_async<T>(
&mut self,
http_client: &T,
token: &str,
token_type_hint: Option<&str>,
extras: Option<RevokeExtras>,
) -> OidcReturnType<HttpResponse>where
T: OidcHttpClient,
§Revoke Token
Performs a token revocation at Issuer’s revocation_endpoint
http_client
: The http client to make the requesttoken
: The token to be revokedtoken_type_hint
: Hint to which type of token is being revokedextras
: See RevokeExtras
Sourcepub async fn userinfo_async<T>(
&mut self,
http_client: &T,
token_set: &TokenSet,
options: UserinfoOptions<'_>,
) -> OidcReturnType<Value>where
T: OidcHttpClient,
pub async fn userinfo_async<T>(
&mut self,
http_client: &T,
token_set: &TokenSet,
options: UserinfoOptions<'_>,
) -> OidcReturnType<Value>where
T: OidcHttpClient,
§Userinfo
Performs userinfo request at Issuer’s userinfo
endpoint.
http_client
: The http client to make the requesttoken_set
: TokenSet withaccess_token
that will be used to perform the requestoptions
: See UserinfoOptions
Sourcepub async fn request_object_async<T>(
&mut self,
http_client: &T,
request_object: Value,
) -> OidcReturnType<String>where
T: OidcHttpClient,
pub async fn request_object_async<T>(
&mut self,
http_client: &T,
request_object: Value,
) -> OidcReturnType<String>where
T: OidcHttpClient,
§Pushed Authorization Request
Performs a PAR on the pushed_authorization_request_endpoint
http_client
: The http client to make the requestparameters
: See AuthorizationParametersextras
: See PushedAuthorizationRequestExtras
§Device Authorization Grant
Performs a Device Authorization Grant at device_authorization_request_endpoint
.
http_client
- The http client to make the requestparams
- See DeviceAuthorizationParamsextras
- See DeviceAuthorizationExtras
Sourcepub async fn ciba_authenticate_async<T: OidcHttpClient>(
&mut self,
http_client: &T,
request: CibaAuthRequest,
extras: Option<CibaAuthenticationExtras>,
) -> OidcReturnType<(CibaAuthResponse, Option<CibaHandle>)>
pub async fn ciba_authenticate_async<T: OidcHttpClient>( &mut self, http_client: &T, request: CibaAuthRequest, extras: Option<CibaAuthenticationExtras>, ) -> OidcReturnType<(CibaAuthResponse, Option<CibaHandle>)>
§CIBA Authenticate
Performs CIBA Authentication request at backchannel_authentication_endpoint