response_type=id_token&response_mode=form_post
. Due to the response_type=id_token
request parameter, the response contains the ID Token directly, instead of the authorization code, while the response_mode=form_post
encodes the ID Token with the rest of the Authorization Response parameters as HTML form values that are auto-submitted in the User Agent. This way you can have an optimized authentication flow (no need to exchange the code for an ID Token), however you have to make sure that it is supported by the technology you are using to implement your app (ASP .NET Core middleware does support it). For more details refer to the OAuth 2.0 Form Post Response Mode specification.
The ID Token (usually referred to as id_token
in code samples) is a JSON Web Token (JWT) that contains identity data. It is consumed by the application and used to get user information like the user’s name, email, and so forth, typically used for UI display.
iss
(issuer) claim.aud
(audience) claim should contain the Application’s client_id
value. The ID Token must be rejected if the ID Token does not list the Application as a valid audience, or if it contains additional audiences not trusted by the Application.azp
claim is present.azp
(authorized party) claim is present, the Application should verify that its client_id
is the claim value.alg
header parameter. The Application must use the keys provided by the Issuer.alg
value should be the default of RS256
or the algorithm sent by the Application in the id_token_signed_response_alg
parameter during registration.alg
header parameter uses a MAC based algorithm such as HS256
, HS384
, or HS512
, the octets of the UTF-8 representation of the client_secret
corresponding to the client_id
contained in the aud
(audience) claim are used as the key to validate the signature. For MAC based algorithms, the behavior is unspecified if the aud
is multi-valued or if an azp
value is present that is different than the aud
value.exp
claim.iat
claim can be used to reject tokens that were issued too far away from the current time, limiting the amount of time that nonces need to be stored to prevent attacks. The acceptable range is Application specific.nonce
value was sent in the Authentication Request, a nonce
claim must be present and its value checked to verify that it is the same value as the one that was sent in the Authentication Request. The Application should check the nonce
value for replay attacks. The precise method for detecting replay attacks is Application specific.acr
claim was requested, the Application should check that the asserted claim value is appropriate.auth_time
claim was requested, either through a specific request for this claim or by using the max_age
parameter, the Application should check the auth_time
claim value and request re-authentication if it determines too much time has elapsed since the last End-User authentication.