Struct openid_client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Implementations§

source§

impl Client

source

pub fn from_uri( registration_client_uri: &str, registration_access_token: Option<String>, jwks: Option<Jwks>, client_options: Option<ClientOptions>, issuer: Option<&Issuer> ) -> Result<Self, OidcClientError>

Creates a client from the Client Read Endpoint

This is a blocking method. Checkout Client::from_uri_async() for async version.

Creates a Client from the Client read endpoint.

The Jwks is completely ignored if the jwks_uri is present from the response.


fn main() {
    let client =
        Client::from_uri("https://auth.example.com/client/id", None, None, None, None);
}

TODO: Document snippets using rest of the arguments

source

pub fn from_uri_with_interceptor( registration_client_uri: &str, interceptor: RequestInterceptor, registration_access_token: Option<String>, jwks: Option<Jwks>, client_options: Option<ClientOptions>, issuer: Option<&Issuer> ) -> Result<Self, OidcClientError>

Creates a client with request interceptor from the Client Read Endpoint

This is a blocking method. Checkout Client::from_uri_with_interceptor_async() for async version.


fn main() {
    let client =
        Client::from_uri_with_interceptor("https://auth.example.com/client/id", None, None, None, None);
}

TODO: Document snippets using rest of the arguments

source

pub async fn from_uri_async( registration_client_uri: &str, registration_access_token: Option<String>, jwks: Option<Jwks>, client_options: Option<ClientOptions>, issuer: Option<&Issuer> ) -> Result<Self, OidcClientError>

Creates a client from the Client Read Endpoint

This is an async method. Checkout Client::from_uri() for the blocking version.

Creates a Client from the Client read endpoint.

The Jwks is completely ignored if the jwks_uri is present from the response.


fn main() {
    let client =
        Client::from_uri_async("https://auth.example.com/client/id", None, None, None, None);
}

TODO: Document snippets using rest of the arguments

source

pub async fn from_uri_with_interceptor_async( registration_client_uri: &str, interceptor: RequestInterceptor, registration_access_token: Option<String>, jwks: Option<Jwks>, client_options: Option<ClientOptions>, issuer: Option<&Issuer> ) -> Result<Self, OidcClientError>

Creates a client with request interceptor from the Client Read Endpoint

This is an async method. Checkout Client::from_uri_with_interceptor() for the blocking version.


fn main() {
    let client =
        Client::from_uri_with_interceptor_async("https://auth.example.com/client/id", None, None, None, None);
}

TODO: Document snippets using rest of the arguments

source§

impl Client

Getter & Setter method implementations for Client

source

pub fn get_client_id(&self) -> String

Get client id

source

pub fn get_client_secret(&self) -> Option<String>

Get client secret

source

pub fn get_grant_types(&self) -> Vec<String>

Get grant types

source

pub fn get_id_token_signed_response_alg(&self) -> String

Get id token signed response algorithm

source

pub fn get_response_types(&self) -> Vec<String>

Get response types. See ClientMetadata.

source

pub fn get_token_endpoint_auth_method(&self) -> String

Get token endpoint authentication method. See ClientMetadata.

source

pub fn get_token_endpoint_auth_signing_alg(&self) -> Option<String>

Get token endpoint authentication signing alg. See ClientMetadata.

source

pub fn get_introspection_endpoint_auth_method(&self) -> Option<String>

Get introspection endpoint authentication method. See ClientMetadata.

source

pub fn get_introspection_endpoint_auth_signing_alg(&self) -> Option<String>

Get introspection endpoint authentication signing alg. See ClientMetadata.

source

pub fn get_revocation_endpoint_auth_method(&self) -> Option<String>

Get revocation endpoint authentication method. See ClientMetadata.

source

pub fn get_revocation_endpoint_auth_signing_alg(&self) -> Option<String>

Get revocation endpoint authentication signing alg. See ClientMetadata.

source

pub fn get_field(&self, key: &str) -> Option<&Value>

Gets a field from other_fields

source

pub fn get_redirect_uri(&self) -> Option<String>

Get redirect uri. See ClientMetadata.

source

pub fn get_redirect_uris(&self) -> Option<Vec<String>>

Get redirect uris. See ClientMetadata.

source

pub fn get_response_type(&self) -> Option<String>

Get response type

source

pub fn get_issuer(&self) -> Option<&Issuer>

Gets the issuer that the client was created with.

Trait Implementations§

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 !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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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> 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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

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

§

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