## Config

# Struct Config

Source

    pub struct Config {Show 38 fields
        pub issuer: Url,
        pub authorization_endpoint: Url,
        pub token_endpoint: Url,
        pub userinfo_endpoint: Option<Url>,
        pub jwks_uri: Url,
        pub registration_endpoint: Option<Url>,
        pub scopes_supported: Option<Vec<String>>,
        pub response_types_supported: Vec<String>,
        pub response_modes_supported: Option<Vec<String>>,
        pub grant_types_supported: Option<Vec<String>>,
        pub acr_values_supported: Option<Vec<String>>,
        pub subject_types_supported: Vec<String>,
        pub id_token_signing_alg_values_supported: Vec<String>,
        pub id_token_encryption_alg_values_supported: Option<Vec<String>>,
        pub id_token_encryption_enc_values_supported: Option<Vec<String>>,
        pub userinfo_signing_alg_values_supported: Option<Vec<String>>,
        pub userinfo_encryption_alg_values_supported: Option<Vec<String>>,
        pub userinfo_encryption_enc_values_supported: Option<Vec<String>>,
        pub request_object_signing_alg_values_supported: Option<Vec<String>>,
        pub request_object_encryption_alg_values_supported: Option<Vec<String>>,
        pub request_object_encryption_enc_values_supported: Option<Vec<String>>,
        pub token_endpoint_auth_methods_supported: Option<Vec<String>>,
        pub token_endpoint_auth_signing_alg_values_supported: Option<Vec<String>>,
        pub display_values_supported: Option<Vec<String>>,
        pub claim_types_supported: Option<Vec<String>>,
        pub claims_supported: Option<Vec<String>>,
        pub service_documentation: Option<Url>,
        pub claims_locales_supported: Option<Vec<String>>,
        pub ui_locales_supported: Option<Vec<String>>,
        pub claims_parameter_supported: bool,
        pub request_parameter_supported: bool,
        pub request_uri_parameter_supported: bool,
        pub require_request_uri_registration: bool,
        pub op_policy_uri: Option<Url>,
        pub op_tos_uri: Option<Url>,
        pub end_session_endpoint: Option<Url>,
        pub introspection_endpoint: Option<Url>,
        pub code_challenge_methods_supported: Option<Vec<String>>,
    }

Expand description

Config represents an OpenID / OAuth 2.0 provider metadata.

OpenID / OAuth 2.0 Providers have metadata describing their configuration. These OpenID / OAuth 2.0 Provider Metadata values are used by OpenID Connect / OAuth 2.0 Authorization.

See:

- OpenID Connect Discovery 1.0: OpenID Provider Metadata
- https://datatracker.ietf.org/doc/html/rfc8414

## Fields§

§`issuer: Url`

The authorization server’s issuer identifier.

URL using the `https` scheme with no query or fragment components that the OP asserts as its Issuer Identifier. If Issuer discovery is supported (see Section 2), this value MUST be identical to the issuer value returned by WebFinger. This also MUST be identical to the `iss` Claim value in ID Tokens issued from this Issuer.

§`authorization_endpoint: Url`

URL of the OP’s OAuth 2.0 Authorization Endpoint OpenID.Core.

This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components.

§`token_endpoint: Url`

URL of the OP’s OAuth 2.0 Token Endpoint OpenID.Core.

This is the URL where clients will send a request to exchange an authorization code for an access token. This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components.

§`userinfo_endpoint: Option<Url>`

The user info endpoint.

URL of the OP’s UserInfo Endpoint OpenID.Core. This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components.

§`jwks_uri: Url`

The JWKS URI.

URL of the OP’s JWK Set JWK document, which MUST use the `https` scheme. This contains the signing key(s) the RP uses to validate signatures from the OP. The JWK Set MAY also contain the Server’s encryption key(s), which are used by RPs to encrypt requests to the Server. When both signing and encryption keys are made available, a `use` (public key use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key’s intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK `x5c` parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. The JWK Set MUST NOT contain private or symmetric key values.

§`registration_endpoint: Option<Url>`

The dynamic client registration endpoint.

URL of the OP’s Dynamic Client Registration Endpoint OpenID.Registration, which MUST use the `https` scheme.

§`scopes_supported: Option<Vec<String>>`

The scopes supported.

JSON array containing a list of the OAuth 2.0: RFC6749 scope values that this server supports. The server MUST support the `openid` scope value. Servers MAY choose not to advertise some supported scope values even when this parameter is used, although those defined in OpenID.Core SHOULD be listed, if supported.

§`response_types_supported: Vec<String>`

JSON array containing a list of the OAuth 2.0 `response_type` values that this OP supports. Dynamic OpenID Providers MUST support the `code,id_token`, and the `id_token` token Response Type values.

§`response_modes_supported: Option<Vec<String>>`

JSON array containing a list of the OAuth 2.0 `response_mode` values that this OP supports, as specified in OAuth 2.0 Multiple Response Type Encoding Practices. If omitted, the default for Dynamic OpenID Providers is `["query", "fragment"]`.

§`grant_types_supported: Option<Vec<String>>`

JSON array containing a list of the OAuth 2.0 Grant Type values that this OP supports. Dynamic OpenID Providers MUST support the `authorization_code` and `implicit` Grant Type values and MAY support other Grant Types. If omitted, the default value is `["authorization_code", "implicit"]`.

§`acr_values_supported: Option<Vec<String>>`

JSON array containing a list of the Authentication Context Class References that this OP supports.

§`subject_types_supported: Vec<String>`

JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include `pairwise` and `public`.

§`id_token_signing_alg_values_supported: Vec<String>`

JSON array containing a list of the JWS signing algorithms (`alg` values) supported by the OP for the ID Token to encode the Claims in a JWT. The algorithm `RS256` MUST be included. The value `none` MAY be supported but MUST NOT be used unless the Response Type used returns no ID Token from the Authorization Endpoint (such as when using the Authorization Code Flow).

§`id_token_encryption_alg_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWE encryption algorithms (`alg` values) supported by the OP for the ID Token to encode the Claims in a JWT.

§`id_token_encryption_enc_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWE encryption algorithms (`enc` values) supported by the OP for the ID Token to encode the Claims in a JWT.

§`userinfo_signing_alg_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWS signing algorithms (`alg` values) JWA supported by the UserInfo Endpoint to encode the Claims in a JWT. The value `none` MAY be included.

§`userinfo_encryption_alg_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWE encryption algorithms (`alg` values) JWA supported by the UserInfo Endpoint to encode the Claims in a JWT.

§`userinfo_encryption_enc_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWE encryption algorithms (`enc` values) JWA supported by the UserInfo Endpoint to encode the Claims in a JWT.

§`request_object_signing_alg_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWS signing algorithms (`alg` values) supported by the OP for Request Objects, which are described in Section 6.1 of OpenID Connect Core 1.0 OpenID.Core. These algorithms are used both when the Request Object is passed by value (using the `request` parameter) and when it is passed by reference (using the `request_uri` parameter). Servers SHOULD support `none` and `RS256`.

§`request_object_encryption_alg_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWE encryption algorithms (`alg` values) supported by the OP for Request Objects. These algorithms are used both when the Request Object is passed by value and when it is passed by reference.

§`request_object_encryption_enc_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWE encryption algorithms (`enc` values) supported by the OP for Request Objects. These algorithms are used both when the Request Object is passed by value and when it is passed by reference.

§`token_endpoint_auth_methods_supported: Option<Vec<String>>`

JSON array containing a list of Client Authentication methods supported by this Token Endpoint. The options are `client_secret_post`, `client_secret_basic`, `client_secret_jwt`, and `private_key_jwt`, as described in Section 9 of OpenID Connect Core 1.0 OpenID.Core. Other authentication methods MAY be defined by extensions. If omitted, the default is client_secret_basic – the HTTP Basic Authentication Scheme specified in Section 2.3.1 of OAuth 2.0: RFC6749.

§`token_endpoint_auth_signing_alg_values_supported: Option<Vec<String>>`

JSON array containing a list of the JWS signing algorithms (alg values) supported by the Token Endpoint for the signature on the JWT used to authenticate the Client at the Token Endpoint for the private_key_jwt and client_secret_jwt authentication methods. Servers SHOULD support RS256. The value none MUST NOT be used.

§`display_values_supported: Option<Vec<String>>`

JSON array containing a list of the display parameter values that the OpenID Provider supports. These values are described in Section 3.1.2.1 of OpenID Connect Core 1.0 OpenID.Core

§`claim_types_supported: Option<Vec<String>>`

The claim types supported by the OpenID Connect provider.

JSON array containing a list of the Claim Types that the OpenID Provider supports. These Claim Types are described in Section 5.6 of OpenID Connect Core 1.0 OpenID.Core. Values defined by this specification are normal, aggregated, and distributed. If omitted, the implementation supports only normal Claims.

§`claims_supported: Option<Vec<String>>`

The claims supported by the OpenID Connect provider.

JSON array containing a list of the Claim Names of the Claims that the OpenID Provider MAY be able to supply values for. Note that for privacy or other reasons, this might not be an exhaustive list.

§`service_documentation: Option<Url>`

The service documentation URL of the OpenID Connect provider.

URL of a page containing human-readable information that developers might want or need to know when using the OpenID Provider. In particular, if the OpenID Provider does not support Dynamic Client Registration, then information on how to register Clients needs to be provided in this documentation.

§`claims_locales_supported: Option<Vec<String>>`

The supported claim locales for the OpenID Connect provider.

Languages and scripts supported for values in Claims being returned, represented as a JSON array of BCP47 RFC5646 language tag values. Not all languages and scripts are necessarily supported for all Claim values.

§`ui_locales_supported: Option<Vec<String>>`

The UI locales supported by the OpenID Connect provider.

Languages and scripts supported for the user interface, represented as a JSON array of BCP47 RFC5646 language tag values.

§`claims_parameter_supported: bool`

Boolean value specifying whether the OP supports use of the `claims` parameter, with `true` indicating support. If omitted, the default value is `false`.

§`request_parameter_supported: bool`

Boolean value specifying whether the OP supports use of the `request` parameter, with `true` indicating support. If omitted, the default value is `false`.

§`request_uri_parameter_supported: bool`

Boolean value specifying whether the OP supports use of the `request_uri` parameter, with `true` indicating support. If omitted, the default value is `false`.

§`require_request_uri_registration: bool`

Boolean value specifying whether the OP requires any `request_uri` values used to be pre-registered using the `request_uris` registration parameter. Pre-registration is REQUIRED when the value is `true`. If omitted, the default value is `false`.

§`op_policy_uri: Option<Url>`

URL that the OpenID Provider provides to the person registering the Client to read about the OP’s requirements on how the Relying Party can use the data provided by the OP. The registration process SHOULD display this URL to the person registering the Client if it is given.

§`op_tos_uri: Option<Url>`

URL that the OpenID Provider provides to the person registering the Client to read about the OpenID Provider’s terms of service. The registration process SHOULD display this URL to the person registering the Client if it is given.

§`end_session_endpoint: Option<Url>`

The end session endpoint of the OpenID Connect provider.

This is the URL where clients will send a request to invalidate an existing authorization code. It should be a fully qualified URL and must include a scheme (such as `http` or `https`) followed by a host, path, query parameters, and fragment.

§`introspection_endpoint: Option<Url>`

The introspection endpoint of the OpenID Connect provider.

This is the URL where clients will send a request to check the validity of an access token. It should be a fully qualified URL and must include a scheme (such as `http` or `https`) followed by a host, path, query parameters, and fragment.

§`code_challenge_methods_supported: Option<Vec<String>>`

The code challenge methods supported by the OpenID Connect provider.

This is an optional list of code challenge method strings that the service supports. This is a NONSTANDARD extension Google uses that is a part of the OAuth discovery draft.

## Trait Implementations§

Source§

### impl Clone for Config

Source§

#### fn clone(&self) -> Config

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

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

Performs copy-assignment from `source`. Read more
Source§

### impl Debug for Config

Source§

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

Formats the value using the given formatter. Read more
Source§

### impl<'de> Deserialize<'de> for Config

Source§

#### fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

### impl From<Config> for Discovered

Source§

#### fn from(value: Config) -> Self

Converts to this type from the input type.
Source§

### impl Serialize for Config

Source§

#### fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

## Auto Trait Implementations§

§

### impl Freeze for Config

§

### impl RefUnwindSafe for Config

§

### impl Send for Config

§

### impl Sync for Config

§

### impl Unpin for Config

§

### impl UnwindSafe for Config

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

§

### impl<T> Instrument for T

§

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

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

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

§

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

§

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

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

### impl<T> ServiceExt for T

§

#### fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

#### fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

#### fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

#### fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the `Standard` policy. Read more
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.
§

### impl<T> WithSubscriber for T

§

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

#### fn with_current_subscriber(self) -> WithDispatch<Self>

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

### impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,