Step-by-step demonstration of OAuth PKCE flow with Cognito managed login
Redirect to Cognito's managed login page with response_type=token to request tokens directly.
After successful authentication, Cognito returns tokens directly in the URL fragment.
Generate a cryptographically secure random string (43-128 characters) that will be used to prove the authorization request came from this client.
Compute the SHA-256 hash of the code verifier and base64url encode it. This challenge will be sent to the authorization server.
Redirect to Cognito's managed login page with response_type=code and the code challenge as part of the OAuth 2.0 authorization request.
After successful authentication, Cognito redirects back with an authorization code.
Exchange the authorization code for ID, Access, and Refresh tokens using the code verifier.