The Google exchange, step by step
The real URLs and parameters, walked end to end.
Open this lesson in the learning hubKey points
- The flow is the standard authorization code flow, with Google as the authorization server.
scope=openidis what makes it OpenID Connect and produces an ID token.statestill must be generated and checked - Google does not do this for you.nonceis echoed into the ID token, which binds the token to your specific request.- The token endpoint returns
id_token,access_tokenand sometimesrefresh_tokentogether.
Validate the ID token fully, then issue your own session - do not keep using Google tokens as your auth.
This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the OAuth with Google course, and every lesson in it is listed on the OAuth with Google contents page.