feat(criipto): handle DanishMitID CprEntry exchange screen#14
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Criipto added a CPR-entry screen after the MitID auth-code callback, shown when the OIDC scope includes
ssn. It's served as a200HTML page atDKMitId/Exchange?cs_v1=…, sofollowRedirects(which only follows 3xx) stalled there and login never reached the relying-party session.This adds an optional
advance(page, cookies, context)hook onProviderSession. After the auth-code exchange,login()loopsadvanceuntil the broker stops handing back screens (bounded; throws if it never settles). Criipto'sadvanceparses thedata-bootstrapblob and, forDanishMitID/CprEntry, POSTs the CPR to the screen's form and follows the redirect on to the RP callback; it returnsnullon the RP's own page and throws a named error for unknown screens. The CPR is threaded from the resolved test identity viaLoginOptions { cpr }. No-op fornemloginanddirectMitid.