OAuth 2.0 is an authorization framework: it lets a user or service grant delegated access to resources through tokens, without exposing the user’s password. It answers what a client is allowed to do; OpenID Connect (OIDC) handles who the user or service is. section 11.3.2
Choose a flow for the situation:
- Use Authorization Code Flow with PKCE when a person signs into a web or mobile app. PKCE protects the temporary login code when the app cannot safely keep a permanent client secret. section 11.3.2
- Use Client Credentials Flow when one backend service needs to access another and no person is involved. section 11.3.2
Table 11.1 Selecting the Correct OAuth 2.0 Flow by Architectural Scenario
|
Scenario
|
Recommended OAuth 2.0 Flow
|
Key Characteristic
|
|
Human User logging into a web or mobile app.
|
Authorization Code Flow (with PKCE)
|
Redirects the user to a secure login page hosted by the IdP.
|
|
Backend Service talking to another service (Machine-to-Machine).
|
Client Credentials Flow
|
No humans are involved; the service uses its own ID and Secret to obtain a token.
|
Compare the recommended flow for human sign-in with the flow for service-to-service access. section 11.3.2
An Identity Provider (IdP) can issue tokens while centralizing identity management. In the valet-key analogy, OAuth grants permission to drive the car, not open its glovebox: access should match the task. section 11.3.2 section 11.10










