# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class ConnectionsOidcMetadata(UniversalBaseModel):
    """
    Additional OIDC metadata to include in the discovery document. Only applicable when strategy=oidc, okta, or samlp.
    """

    issuer: typing.Optional[str] = pydantic.Field(default=None)
    """
    The identity provider's unique issuer identifier URL (e.g., https://accounts.google.com). Must match the 'iss' claim in ID tokens from the identity provider.
    """

    authorization_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL of the identity provider's OAuth 2.0 authorization endpoint where users are redirected for authentication. Must be a valid HTTPS URL. This endpoint initiates the OAuth 2.0 authorization code flow.
    """

    token_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL of the identity provider's OAuth 2.0 token endpoint where authorization codes are exchanged for access tokens. Must be a valid HTTPS URL. Required for authorization code flow but optional for implicit flow.
    """

    userinfo_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional URL of the identity provider's UserInfo endpoint. When configured with attribute mapping, Auth0 calls this endpoint to retrieve additional user profile claims using the access token.
    """

    jwks_uri: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL of the identity provider's JSON Web Key Set (JWKS) endpoint containing public keys for signature verification. Auth0 retrieves these keys to validate ID token signatures.
    """

    registration_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL of the OPs Dynamic Client Registration Endpoint. RECOMMENDED but not REQUIRED. https://openid.net/specs/openid-connect-discovery-1_0.html#OpenID.Registration
    """

    scopes_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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. RECOMMENDED but not REQUIRED
    """

    response_modes_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    A list of the OAuth 2.0 response_mode values that this OP supports. If omitted, the default for Dynamic OpenID Providers is ["query", "fragment"]
    """

    response_types_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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 token id_token Response Type values
    """

    grant_types_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    A list of the Authentication Context Class References that this OP supports
    """

    subject_types_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    A list of the Subject Identifier types that this OP supports. Valid types include pairwise and public
    """

    id_token_signing_alg_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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). https://datatracker.ietf.org/doc/html/rfc7518
    """

    id_token_encryption_alg_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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 [JWT].
    """

    userinfo_signing_alg_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    JSON array containing a list of the JWS [JWS] signing algorithms (alg values) [JWA] supported by the UserInfo Endpoint to encode the Claims in a JWT [JWT]. The value none MAY be included.
    """

    userinfo_encryption_alg_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    JSON array containing a list of the JWE [JWE] encryption algorithms (alg values) [JWA] supported by the UserInfo Endpoint to encode the Claims in a JWT [JWT].
    """

    userinfo_encryption_enc_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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 [JWT].
    """

    request_object_signing_alg_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    JSON array containing a list of the JWS signing algorithms (alg values) supported by the Token Endpoint for the signature on the JWT [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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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]. If omitted, the implementation supports only normal Claims.
    """

    claims_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[str] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    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: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Languages and scripts supported for the user interface, represented as a JSON array of BCP47 [RFC5646] language tag values.
    """

    claims_parameter_supported: typing.Optional[bool] = pydantic.Field(default=None)
    """
    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: typing.Optional[bool] = pydantic.Field(default=None)
    """
    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: typing.Optional[bool] = pydantic.Field(default=None)
    """
    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: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Boolean value specifying whether the OP requires use of the request_uri parameter. If omitted, the default value is false.
    """

    op_policy_uri: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL that the OpenID Provider provides to the person registering the Client to read about the OPs 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: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL that the OpenID Provider provides to the person registering the Client to read about OpenID Providers terms of service. The registration process SHOULD display this URL to the person registering the Client if it is given.
    """

    end_session_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL of the identity provider's logout/end session endpoint. When configured as a static URL, users are redirected here after logging out from Auth0. Must use HTTPS scheme.
    """

    dpop_signing_alg_values_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    JSON array containing a list of the JWS signing algorithms (alg values) supported for DPoP proof JWT signing.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
