Skip to content

feat(criipto): handle DanishMitID CprEntry exchange screen#14

Merged
Saturate merged 1 commit into
mainfrom
feat/criipto-cpr-entry-screen
Jun 15, 2026
Merged

feat(criipto): handle DanishMitID CprEntry exchange screen#14
Saturate merged 1 commit into
mainfrom
feat/criipto-cpr-entry-screen

Conversation

@Saturate

Copy link
Copy Markdown
Owner

Criipto added a CPR-entry screen after the MitID auth-code callback, shown when the OIDC scope includes ssn. It's served as a 200 HTML page at DKMitId/Exchange?cs_v1=…, so followRedirects (which only follows 3xx) stalled there and login never reached the relying-party session.

This adds an optional advance(page, cookies, context) hook on ProviderSession. After the auth-code exchange, login() loops advance until the broker stops handing back screens (bounded; throws if it never settles). Criipto's advance parses the data-bootstrap blob and, for DanishMitID/CprEntry, POSTs the CPR to the screen's form and follows the redirect on to the RP callback; it returns null on the RP's own page and throws a named error for unknown screens. The CPR is threaded from the resolved test identity via LoginOptions { cpr }. No-op for nemlogin and directMitid.

Criipto now interposes a CPR-entry screen after the auth-code callback
when the OIDC scope includes "ssn": DKMitId/Exchange returns a 200 React
page instead of a 3xx, so followRedirects stalled there and never reached
the relying-party session.

Add an optional `advance` hook to ProviderSession; after the exchange the
login flow loops it until the broker stops handing back screens. Criipto's
advance submits the CPR (threaded from the resolved identity) to the
screen's form and follows the redirect on to the RP callback. It's a no-op
for brokers that don't interpose screens, so nemlogin and directMitid are
unaffected.
@Saturate Saturate merged commit 85ffd2b into main Jun 15, 2026
3 checks passed
@Saturate Saturate deleted the feat/criipto-cpr-entry-screen branch June 15, 2026 11:48
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.

1 participant