Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

§Client instance

Implementations§

Source§

impl Client

Source

pub fn get_other_fields(&self) -> &HashMap<String, Value>

Gets the extra fields in client

Source§

impl Client

Implementation for Client Read Methods

Source

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 request
  • registration_client_uri - The client read endpoint
  • issuer - Issuer
  • registration_access_token - The access token to be sent with the request
  • jwks - Private Jwks of the client
  • client_options - The ClientOptions
  • fapi - Fapi version.
Source§

impl Client

Implementations for Dynamic Client Registration

Source

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 request
  • issuer - The Issuer client should be registered to.
  • client_metadata - The ClientMetadata to be sent using the registration request.
  • register_options - ClientRegistrationOptions
  • fapi - Fapi version.
Source

pub fn metadata(&self) -> ClientMetadata

§Get Client Metadata

Gets the ClientMetadata of this Client instance

Source§

impl Client

Implementation for Client

Source

pub fn is_fapi(&self) -> bool

Returns if the client is fapi or not

Source

pub fn is_fapi1(&self) -> bool

Returns if the client is fapi 1 or not

Source

pub fn is_fapi2(&self) -> bool

Returns if the client is fapi 2 or not

Source

pub fn authorization_url( &self, parameters: AuthorizationParameters, ) -> OidcReturnType<Url>

§Authorization Url

Builds an authorization url with respect to the parameters

Source

pub fn end_session_url( &self, parameters: EndSessionParameters, ) -> OidcReturnType<Url>

§End Session Url

Builds an endsession url with respect to the parameters

Source

pub fn authorization_post( &self, parameters: AuthorizationParameters, ) -> OidcReturnType<String>

§Authorization Post

Builds an authorization post page with respect to the parameters

Source

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 request
  • params - Token grant params
Source

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 request
  • params - OAuth callback params
Source

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

Source

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

Source

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”.

Source

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 request
  • params - OpenId callback params
Source

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 request
  • token : The token to introspect
  • token_type_hint : Type of the token passed in token. Usually access_token or refresh_token
  • extras: See IntrospectionExtras
Source

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.

Source

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 GET
  • incoming_body : Incoming body. Use this param if the request is of the type POST

Only one of the above parameter is parsed.

Source

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 request
  • token_set : TokenSet with refresh token that will be used to perform the request
  • extras : See RefreshTokenExtras
Source

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 request
  • token : The token to be revoked
  • token_type_hint : Hint to which type of token is being revoked
  • extras : See RevokeExtras
Source

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 request
  • token_set : TokenSet with access_token that will be used to perform the request
  • options : See UserinfoOptions
Source

pub async fn request_object_async<T>( &mut self, http_client: &T, request_object: Value, ) -> OidcReturnType<String>
where T: OidcHttpClient,

§Request Object

Creates a request object for JAR

  • http_client : The http client to make the request
  • request_object : A Value which should be an object
Source

pub async fn pushed_authorization_request_async<T>( &mut self, http_client: &T, parameters: Option<AuthorizationParameters>, extras: Option<PushedAuthorizationRequestExtras<'_>>, ) -> OidcReturnType<ParResponse>
where T: OidcHttpClient,

§Pushed Authorization Request

Performs a PAR on the pushed_authorization_request_endpoint

Source

pub async fn device_authorization_async<T>( &mut self, http_client: &T, params: DeviceAuthorizationParams, extras: Option<DeviceAuthorizationExtras>, ) -> OidcReturnType<DeviceFlowHandle>
where T: OidcHttpClient,

§Device Authorization Grant

Performs a Device Authorization Grant at device_authorization_request_endpoint.

Source

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

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,