PKCE is an OAuth 2.0 security extension for public clients, such as mobile and single-page web apps, which cannot safely store a permanent client secret. For each login, the client creates a temporary code verifier and a code challenge. If an app intercepts the authorization code, it cannot use it without the verifier—the puzzle’s solution. section 11.3.2
A user login
A person logging into a mobile or web app uses the Authorization Code Flow with PKCE. If another app intercepts the temporary login code, the verifier prevents that code from being useful on its own. 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 when to use the Authorization Code Flow with PKCE versus the Client Credentials Flow. section 11.3.2





