I had to delve into it for my own reasons and write, so I will post what I learned here ...
Firstly, I will answer the question at the risk of stating the obvious: the ID token cannot be trusted, and its contents should be ignored if the current time is longer than the elapsed time. The response to the questionnaire indicates that after the initial user authentication, the ID is not used again. However, since the ID is signed by the identity provider, it can certainly be useful at any time to enable you to reliably determine who is the user of other services that the application can use. Using a simple user ID or email address is not reliable because it can be easily faked (anyone can send an email address or user ID), but since the OIDC token is signed by the authorization server (which also usually has the advantage of being a third party), it does not can be tampered with and is a much more reliable authentication mechanism.
For example, a mobile application may want to indicate the server service that the user is using, and this may be required after a short period after the initial authentication, after which the ID has expired, and therefore cannot be used to authenticate the user.
Thus, just like the access token (used for authorization - specify what permissions the user has), can be updated, can the identifier token be updated (used for authentication - indicate who the user is)? According to the OIDC specification, the answer is not obvious. OIDC / OAuth has three “streams” for receiving tokens, an authorization code stream, an implicit stream, and a hybrid stream (which I will skip below because this is a variant of the other two).
For an implicit flow in OIDC / OAuth, you request an identifier token at the authorization endpoint, redirecting the user in the browser to the authorization endpoint and including id_token as the value of the response_type request parameter. Response to the implicit stream of successful authentication id_token include id_token .
For the authentication code stream, the client indicates code as the value of the response_type request parameter when redirecting the user to the authorization endpoint. A successful response includes an authorization code. The client client makes a request to the token endpoint with an authorization code and, according to OIDC Core Section 3.1.3.3 Successfully responding to the token , the response MUST include the identifier token.
So, for any thread, how do you get the identifier token first, but how to update it? OIDC Section 12: Using update tokens contains the following expression about the response to the update token:
After successfully checking the update token, the response body is the token response in section 3.1.3.3, except that it may not contain id_token .
It may not contain an identifier token, and since there is no indication to force it to include an identifier token, you should assume that the response will not contain an identifier token. Thus, technically there is no specific way to “update” an identifier token using an update token. Thus, the only way to obtain a new identifier token is to reauthorize / authenticate the user by redirecting the user to the authorization endpoint and starting the implicit stream or authentication code stream, as described above. The OIDC specification adds a prompt request parameter to the authorization request so that the client can request that the authorization server does not request any user interface from the user, but the redirection should still occur.