The authorization code flow lets an application obtain an access token without handling the user’s service credentials. The user signs in with the provider, approves requested access, and returns with a short-lived authorization code. section 25.1.3
The flow proceeds in a small chain of handoffs:
- Redirect the user to the provider, such as Facebook, for sign-in. section 25.1.3
- Show a consent screen describing the data the application wants to access. section 25.1.3
- Redirect back to the application with an authorization code. section 25.1.3
- Exchange the code and a client-provider secret for an access token, then call the provider API. section 25.1.3
Dog photos from Facebook
A user asks dogphotos.com to retrieve dog photos from Facebook. Facebook handles sign-in and consent; dogphotos.com receives the authorization code, exchanges it for an access token, and uses that token to retrieve the photos. section 25.1.3
Follow the sequence of redirects, consent, code exchange, and API access in the OAuth 2.0 flow diagram. section 25.1.3







