Skip to content

Add PKCE and handle the passkey enrollment screen in the auth flow - #96

Merged
CJNE merged 3 commits into
mainfrom
pkce-passkey-auth
Aug 31, 2026
Merged

Add PKCE and handle the passkey enrollment screen in the auth flow#96
CJNE merged 3 commits into
mainfrom
pkce-passkey-auth

Conversation

@fredriklj

Copy link
Copy Markdown
Collaborator

The login flow in later versions of the app is changed in two ways that the current implementation does not handle.

  1. The authorization request now sends a PKCE challenge (RFC 7636).

  2. The flow interleaves an optional passkey enrollment screen that need to be declined.

PorscheExceptionError now also carries the response body and request URL, so failures at the token endpoint report what the server actually said instead of a bare status code.

This PR breaks out and refactors core parts of #84.

Auth0 has changed the Porsche login flow in two ways that the current
implementation does not handle.

The authorization request now sends a PKCE challenge (RFC 7636). The
verifier is generated before /authorize and kept on the OAuth2Client so
it survives a captcha round trip, since the challenge is bound to the
Auth0 transaction created by that request. It is sent with the code
exchange at the token endpoint.

The resume URL returned by the Identifier First flow no longer redirects
straight to the callback. Porsche can interleave an optional passkey
enrollment screen, so the redirect chain is walked until the
authorization code appears, declining enrollment when that screen shows
up.

PorscheExceptionError also carries the response body and request URL now,
so failures at the token endpoint report what the server actually said
instead of a bare status code.

Co-authored-by: tietjen <tietjen@users.noreply.github.com>

@CJNE CJNE left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking good, i've tested it as well and seems to work fine, nice job!

@CJNE
CJNE merged commit f56005a into main Aug 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants