OIDC profil - IdP för invånare

OIDC profil - IdP för invånare

Profilen som följs: The Swedish OpenID Connect Profile Version: 1.0 - 2023-12-11

ATK

Krav

Eventuella avsteg

ATK

Krav

Eventuella avsteg

Discovery/Well-known (OP/IdP)

 

1

Följa kraven definierade under Final: OpenID Connect Discovery 1.0 incorporating errata set 2

 

2

Required fält:

  • token_endpoint

  • userinfo_endpoint

  • jwks_uri

  • scopes_supported

  • response_types_supported

  • acr_values_supported

  • subject_types_supported

  • token_endpoint_auth_methods_supported

  • token_endpoint_auth_signing_alg_values_supported

  • claims_supported

  • claims_parameter_supported

  • request_parameter_supported

  • code_challenge_methods_supported

 

Client registration

 

5

An OpenID Provider compliant with this profile MUST still be able to handle the client registration parameters specified in this section and in section 2 of [OpenID.Registration]. This means that if an OpenID Provider registers Relying Parties by other means, it MUST gather and maintain all required client information parameters in the following table.

  • redirect_uris

  • response_types

  • grant_types

  • At least one of jwks or jwks_uri is REQUIRED.

    • To facilitate a smooth key rollover, each JWK of the referenced document SHOULD include a kid parameter.

  • token_endpoint_auth_method

Inte response_types

6

Optional information gathered for client registration:

  • subject_type

    • Subject type requested for responses to this Client. The subject_types_supported discovery parameter contains a list of the supported subject_type values for this server. Valid types include pairwise and public. The default SHOULD be public. See section 3.2.1.1.

  • default_acr_values

    • Default requested Authentication Context Class Reference values.

Finns inte med i 3.2

Authentication request

 

8a

For requests toward the backchannel_authentication_endpoint for CIBA flows, see ATK 8b.

Required for RP i auth-request and required for OP/IdP to process:

  • client_id

    • The client identifier valid at the OpenID Provider/Authorization Server.

  • response_type

    • MUST be set to code

  • scope

    • MUST contain openid

  • state

    • Random string generated by the Relying Party.

    • This value is returned to the Relying Party in the authentication response.

    • Relying Parties MUST use an unguessable random value for the state parameter, where the value has at least 128 bits of entropy.

      Relying Parties MUST validate the value of the state parameter upon return to the redirect URI and MUST ensure that the value is tied to the current session of the user.

      An OpenID Provider MUST include the value of the state parameter in the authentication response.

  • redirect_uri

    • The endpoint where the Relying Party will receive the authentication response.

    • An OpenID Relying Party MUST include the complete redirect URI as a redirect_uri parameter value.

      In order to prevent open redirection and other injection attacks, the OpenID Provider MUST match the entire URI using a direct string comparison against registered values and MUST reject requests with an invalid or missing redirect URI.

 

9a

Additional parameters optional for RP to send but required for OP/IdP to handle:

  • nonce

    • String value used to associate a client session with an ID Token, and to mitigate replay attacks. The value is a (unguessable) random string generated by the Relying Party. The nonce value is returned to the Relying Party in the ID Token.

  • prompt

    • Space delimited, case sensitive list of string values that specifies whether the OpenID Provider prompts the end-user for re-authentication and consent.

    • An OpenID Provider MUST support the prompt parameter according to the requirements in section 3.1.2.1 of [OpenID.Core], with the following extension: If the value of the prompt parameter contains the "login" string value the OpenID Provider MUST prompt the end-user for (re-)authentication.

  • claims

    • An OpenID Provider compliant with this profile MUST support the claims parameter, both when passed as an OAuth parameter and when included in a Request Object (see 2.1.7).

  • acr_values

  • code_challenge, code_challenge_method

 

9b

“request” parameter is optional for RP to send but required for OP/IdP to handle

  • request

    • If a Request Object is signed it MUST contain the iss (issuer) and aud (audience) claims.

    • The iss value MUST be the client ID of the Relying Party (unless it was signed by a different party than the RP).

    • The aud value SHOULD be set to the OpenID Provider's Issuer Identifier URL. [OpenID.Core] also allows for this value to be an URL including the OP Issuer Identifier URL. In practice this means that the OP Authorization Endpoint URL may be used. Therefore, an OpenID Provider compliant with this profile MUST accept aud values that are either the OP Issuer Identifier URL or the Authorization Endpoint on which an authentication request was received.

    • A Relying Party sending an authentication request containing a Request Object SHOULD use the POST method to do so. Since the contents of the request parameter is signed the payload may become too large for using GET.

inte requirement och validering av iss/aud i samband med detta

9c

I undantagsfallet då RP är av typen “public client” så är nedan nämnda parametrar REQUIRED i auth-request för att följa PKCE:

  • code_challenge

  • code_challenge_method

 

Regular Relying Parties (i.e., not Public Clients) SHOULD use the Proof Key for Code Exchange (PKCE) extension, [RFC7636] and include the code_challenge and code_challenge_method parameters.

A "Public Client", i.e., a browser-based web application or a native mobile app with no backend logic, MUST use PKCE and include the code_challenge and code_challenge_method parameters in the authentication request.

When PKCE is used, the code challenge method S256 SHOULD be used.

An OpenID Provider compliant with this profile MUST support the PKCE extension including support for the S256 code challenge method.

An OpenID Provider MUST NOT allow a Relying Party to use the plain code challenge method.

Inget sätt att indikera public client på, så ingen validering på detta

10

When processing a request: An OpenID Provider compliant with this profile MUST follow the requirements stated in section 3.1.2.2 of [OpenID.Core] and the requirements put in section 2.1 of this profile.

 

11

The OpenID Provider MUST NOT proceed with the authentication if the request contains a claims parameter including essential acr values and none of the specified Requested Authentication Context Class Reference values can be used to authenticate the end-user. In these cases the provider SHOULD respond with an unmet_authentication_requirements error as defined in [OpenID.Unmet-AuthnReq]. See section 5.5.1.1 of [OpenID.Core].

unmet_authentication_requirements ej status vid fel loa på acr_values

Authentication responses

 

14

Entities compliant with this profile MUST follow the requirements regarding authentication error responses put in section 3.1.2.6 of [OpenID.Core].

OpenID Providers SHOULD limit the use of error codes to the sets defined in:

All error codes defined in the OpenID Connect and OAuth2 specifications except for access_denied represent error conditions that are caused by either an invalid request or conditions/requirements that can not be met, where access_denied represents that the authentication process was not completed.

 

15

A non-completed authentication process may be caused by:

  • the user denies, or cancels, the authentication process, or,

  • the user agrees to authenticate, but the authentication operation fails.

In the latter case the OpenID Provider MUST inform the user about the error that occurred before responding with an error response.

In both above scenarios the error_description-field of the error response SHOULD be set and contain a description suitable for the Relying Party application logs.

  • the user agrees to authenticate, but the authentication operation fails. - Ej implementerat i 3.2

Client auth

 

16

OpenID Providers compliant with this profile MUST support the private_key_jwt method for client authentication at the Token endpoint

 

17

A Relying Party SHOULD default to use the private_key_jwt method, and in these cases the following claims MUST be included in the token request:

  • client_assertion_type - Set to urn:ietf:params:oauth:client-assertion-type:jwt-bearer

  • client_assertion - The value of the signed client authentication JWT generated. The Relying Party must generate a new assertion JWT for each call to the token endpoint.

 

Tokens

 

19a

A Token Request MUST have the grant_type is set to authorization_code and code carries the value of the code parameter returned in the authentication (authorization) response.

 

19b

A Token Request MUST have the grant_type is set to authorization_code and code carries the value of the code parameter returned in the authentication (authorization) response OR grant_type is set to urn:openid:params:grant-type:ciba

OBS! detta är ett avsteg från ATK 19a för att kunna stödja CIBA OpenID Connect Client-Initiated Backchannel Authentication Flow - Core 1.0

 

20

If PKCE parameters were sent in the authentication request, see section 2.1.8 above, the Token Request MUST include the PKCE code_verifier parameter, and the OpenID Provider MUST process this parameter according to section 4.6 of [RFC7636].

 

21

The token response MUST include an access token (to be used to make UserInfo requests) and an ID Token

 

22

ID Token

Required content:

  • iss

  • sub

  • aud

  • exp

  • iat

  • auth_time

Optional content:

  • nonce

Conditional content:

  • acr

    • REQUIRED if the acr claim was requested as an essential claim (see 2.1 above), otherwise OPTIONAL.

 

23

The lifetime of an ID Token should be kept as short as possible, and MUST NOT exceed 5 minutes. Shorter times are RECOMMENDED when possible.

 

24

Regarding the “sub” claim of the ID token:

An OpenID Provider compliant with this profile MUST support the public type and SHOULD support the pairwise type.

In order to avoid privacy violations an OpenID Provider MUST NOT use an end-user attribute that reveals personal information about the end-user as the value for sub, for example a personal identity number.

Ingen support för public, endast pairwise

25

An OpenID Provider compliant with this profile MUST adhere to section 5.5.1.1 of [OpenID.Core] regarding issuance of the acr claim.

 

Security requirements

 

28

All transactions MUST be protected in transit by TLS as described in [NIST.800-52.Rev2].

 

29

All parties MUST conform to applicable recommendations in section 16, "Security Considerations" of [OAuth2.RFC6749] and those found in "OAuth 2.0 Threat Model and Security Considerations", [RFC6819].

Behöver bekräfta några punkter

30a

All entities compliant with this profile MUST follow the guidelines in [NIST.800-131A.Rev2] regarding use of algorithms and key lengths1. Specifically, for signature and encryption keys the following requirements apply:

  • RSA public keys MUST be at least 2048 bits in length.

 

30b

All entities compliant with this profile MUST follow the guidelines in [NIST.800-131A.Rev2] regarding use of algorithms and key lengths1. Specifically, for signature and encryption keys the following requirements apply:

  • EC public keys MUST be at least 256 bits in length (signature only). The curve NIST Curve P-256 MUST be supported ([RFC5480]), and NIST Curve P-384 and NIST Curve P-521 SHOULD be supported.

 

31a

Entities conforming to this profile MUST support algorithms according to "JSON Web Algorithms (JWA)", [RFC7518], with the following additions:

  • RS256, RSASSA-PKCS1-v1_5 using SHA-256, is listed as recommended in [RFC7518], but is REQUIRED to support by this profile.

  • RSA-OAEP, RSAES OAEP using default parameters, is listed as recommended in [RFC7518], but is REQUIRED to support by this profile.

  • A128GCM and A256GCM, AES GCM using 128/256-bit key, are listed as recommended in [RFC7518], but are REQUIRED by this profile.

The sender of a secure message MUST NOT use an algorithm that is not set as REQUIRED in [RFC7518] or in the listing above, unless it is explicitly declared by the peer in its metadata (Discovery document or Client Registration metadata).

 

31b

Entities conforming to this profile MUST support algorithms according to "JSON Web Algorithms (JWA)", [RFC7518], with the following additions:

  • ES256, ECDSA using P-256 and SHA-256, is listed as recommended in [RFC7518], but is REQUIRED to support by this profile.

Saknas

32

Entities compliant with this profile MUST follow the requirements from section section 10.1 of [OpenID.Core]. This section states the following:

If there are multiple keys in the referenced JWK Set document, a kid value MUST be provided in the JOSE Header.

In order to facilitate for rotation/update of asymmetric keys and to enable for the receiving entity to dynamically update the sender's JWK Set document entities compliant with this profile SHOULD include the kid value also in the cases where its jwks only contains one (signing) key.

 

33

  • An OpenID Provider MUST be prepared to accept and process signed and/or encrypted Request Objects.

  • A Relying Party that signs a Request Object MUST do so using is registered key, and a Relying Party that encrypts a Request Object MUST do so using the OpenID Provider's public key.

  • If a Request Object is signed it MUST contain the iss (issuer) and aud (audience) claims.

  • The iss value MUST be the client ID of the Relying Party (unless it was signed by a different party than the RP).

 

34

ID Tokens issued by OpenID Providers compliant with this profile MUST be signed and MAY be encrypted using the appropriate key of the requesting Relying Party

 

Korrigerande extra krav (Logout)

 

35

Återställ avsteget dokumenterat under https://inera.atlassian.net/wiki/spaces/ST/pages/5335319454/3.1+SAD+-+IdP+-+OIDC-Profil#Avsteg-fr%C3%A5n-arbetsunderlaget gällande id_token_hint där vi också stödjer att skicka in refresh och access-token.

Se istället spec:

id_token_hint

RECOMMENDED. ID Token previously issued by the OP to the RP passed to the Logout Endpoint as a hint about the End-User's current authenticated session with the Client. This is used as an indication of the identity of the End-User that the RP is requesting be logged out by the OP.

 

36

Implementera “logout_hint”

OPTIONAL. Hint to the Authorization Server about the End-User that is logging out. The value and meaning of this parameter is left up to the OP's discretion. For instance, the value might contain an email address, phone number, username, or session identifier pertaining to the RP's session with the OP for the End-User. (This parameter is intended to be analogous to the login_hint parameter defined in Section 3.1.2.1 of OpenID Connect Core 1.0 [OpenID.Core] that is used in Authentication Requests; whereas, logout_hint is used in RP-Initiated Logout Requests.)

 

52

OpenID Providers MUST support the use of the HTTP GET and POST methods defined in RFC 7231 [RFC7231] at the Logout Endpoint.

 


Publik Information