liveBook · Manning

OpenID Connect ID token

As explained in Software Security for Developers

An ID token is an OpenID Connect JWT containing claims about the authenticated end user and the authentication event.

An ID token is an OpenID Connect JWT containing claims about the authenticated end user and the authentication event. It answers “Who is the user?” while an access token answers “What can they access?” section 13.3.1 section 13.5

Keep the two token roles separate:

  • Use the access token for authorization when accessing protected resources. section 12.5
  • Use the ID token to identify and authenticate the user who signed in. section 13.3.1
  • Expect the ID token only with OIDC, because standard OAuth 2.0 does not define it. section 13.3.1
  • Read identity claims such as the user ID, email, name, and other profile information from its JWT payload. section 13.3.1

Authorization-code response

After the client sends the authorization code to the token endpoint, an OIDC response can contain both an access_token and an id_token, along with the openid scope. The access token supports resource authorization; the ID token carries the authenticated user’s identity. section 12.3

OIDC also complements the ID token with the UserInfo endpoint for additional profile data. Nonce and state help protect OIDC flows against replay and CSRF attacks, while session management and logout standardize the surrounding sign-in experience. section 13.3 section 13.6

How Software Security for Developers covers it

How deep it goes
Explains the token’s purpose, JWT requirement, claims, and contrast with access tokens, without detailing claim-validation procedures.
Examples
Uses an authorization-code token response containing access_token, id_token, scope, token_type, and expires_in.
What it assumes
Assumes basic awareness of OAuth 2.0 actors and flows while teaching the authentication gap that OIDC fills.
What you can do after
Evaluate whether a token should authenticate a user or authorize resource access, and identify where extra profile data comes from.
How it connects
Connects OpenID Connect with OAuth 2.0, JWT, access tokens, UserInfo, nonce, state, and session management.

Also explained in

Compare how 3 books explain OpenID Connect ID token →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Security for Developers. The section links point to the parts of the book it draws on.