I have a question about PKCE (RFC 7636). OAuth clients that use the authorization code grant have two components: (1) the portion on the resource owner's device that initiates the authorization request and (2) a redirection endpoint on a server that can accept and send HTTPS messages.
The PKCE extension to OAuth has the clients do this:
- Generate a cryptographic random string called a code_verifier.
- Create a SHA-256 digest of the code_verifier and Base64-encode it. Send that along with the authorization request.
- When the client gets the authorization code and sends it to the token endpoint for an access token, include the original code_verifier value.
Step 2 happens on the resource owner's device. Once the resource owner has approved the request, his/her browser is redirected to the client's redirection endpoint. Step 3 happens at the redirection endpoint.
So the question is, how does the redirection endpoint know the code_verifier value? It was generated on the resource owner's device.