Skip to content

Support the self-service credential change and recent sign-in - #195

Open
PasinduYeshan wants to merge 4 commits into
thunder-id:mainfrom
PasinduYeshan:self-service-current-credential
Open

PasinduYeshan wants to merge 4 commits into
thunder-id:mainfrom
PasinduYeshan:self-service-current-credential

Conversation

@PasinduYeshan

Copy link
Copy Markdown
Contributor

Stacked on #193, which gives an embedded sign-in an access token the user APIs accept. Until #193 merges, this diff also shows its three commits; review the last commit only. This branch is rebased onto main once #193 merges.

Purpose

ThunderID changed how users change their own credentials (thunder-id/thunderid#7086):

  • POST /users/me/update-credentials takes one credential per request: {"name", "currentValue", "newValue"}. The old {"attributes": {...}} body is refused with 400 USR-1017, so every released SDK fails to change a credential today.
  • A credential the user holds needs its current value: missing is 400 USR-1047, wrong is 403 USR-1048.
  • Setting a credential the user does not hold yet, and changing an email or mobile attribute on PUT /users/me, need a recent sign-in (180 seconds by default). Otherwise the server answers 401 with WWW-Authenticate: Bearer error="insufficient_user_authentication", max_age="180".
  • POST /flow/execute takes maxAge when it starts an AUTHENTICATION flow, and asks the user again when their sign-in is older.

This pull request sends the new body, shows the current-value errors where the user can act on them, and handles the recent sign-in challenge: ChangeCredential and UserProfile sign the user in again and send the change once more.


⚠️ Breaking Changes

🔧 Summary of Breaking Changes

The credential change takes one credential with its current value, not a map of new values.

💥 Impact

These take UpdateMeCredentialsPayload ({name, currentValue?, newValue}) instead of Record<string, string>:

  • updateMeCredentials({payload}) in @thunderid/javascript
  • updateUserCredentials(payload, userId?) on the browser, Node, Next.js and Nuxt clients
  • updateUserCredentialsFromRequest(req, payload) in @thunderid/express
  • Nuxt's PATCH /api/auth/user/credentials body ({payload: {...}})

The components need no change from apps. The old shape fails against any ThunderID that has #7086.

🔄 Migration Guide

// Before
await updateMeCredentials({baseUrl, payload: {password: newPassword}});

// After
await updateMeCredentials({baseUrl, payload: {name: 'password', currentValue: currentPassword, newValue: newPassword}});

Leave currentValue out when the user sets the credential for the first time. Catch StepUpRequiredError (or call runWithStepUp) to handle the recent sign-in challenge.


Approach

Core (@thunderid/javascript)

  • updateMeCredentials sends {name, currentValue, newValue}; currentValue only when it is not empty. An empty name or new value is refused before any request.
  • createApiResponseError builds the thrown ThunderIDAPIError from the server's error body: its code, and its message.defaultValue as the message. On a 401 with insufficient_user_authentication (read from WWW-Authenticate, or from the AUTH-4011 body when the header is not readable), it throws StepUpRequiredError with maxAge. parseAuthenticationChallenge reads the header.
  • runWithStepUp(send, {reauthenticate, isActive}) sends a change, signs the user in again on StepUpRequiredError, and sends it once more. It never sends a third time, and it does not resend after the caller's form has closed (JS-STEP_UP-AB01).
  • mapCredentialUpdateError and mapReauthenticationError turn the codes into translated messages for the components. USR-1047 and USR-1048 go to the current-value field.
  • pickRecentSignInParams keeps only max_age (whole seconds) and prompt=login from sign-in options, for the server SDKs.
  • maxAge on EmbeddedSignInFlowInitiateRequest.
  • New strings in all nine languages: current-value field, its hint, the two current-value errors, the re-sign-in dialog's heading, description, close button, and the messages for a re-sign-in that failed, was cancelled, used a different account, or offered only an option that leaves the page.

Browser (@thunderid/browser)

  • reauthenticate({maxAge}) for a session from a redirect sign-in: opens a popup at once (so the browser does not block it) with an authorization request that carries PKCE, a new state and nonce, max_age (or prompt=login without one) and id_token_hint. It replaces the session only when the state, nonce and sub match the request and the signed-in user, and never uses the refresh token for it. The refresh timer pauses while the popup is open. The page in the popup hands the code to its opener and closes.
  • executeReauthenticationFlow(payload, {maxAge}) for a session from an embedded sign-in: starts an AUTHENTICATION flow with maxAge (0 when the challenge has none) and the kept SSO session handles, then continues it step by step. When it completes for the same sub, the assertion is exchanged as in Keep an access token after an embedded sign-in #193 and replaces the session; another user's sign-in is refused with BROWSER-REAUTHENTICATION-DU01 and the session stays.
  • getReauthenticationMethod(): popup, flow (a session from an embedded sign-in, or mode: 'embedded') or unavailable (backend mode). A session from an embedded sign-in is marked with embedded_sign_in, which Keep an access token after an embedded sign-in #193's setSessionFromFlowAssertion now writes and any token endpoint response clears.
  • Each step of the re-sign-in flow keeps the SSO session handles it returns and drops the ones it ends, as signIn does.

React and Vue

  • useThunderID().reauthenticate({maxAge}) opens the popup for a redirect session, and otherwise shows a re-sign-in dialog that runs the flow with BaseSignIn, including a passkey step. A sign-in option that would leave the page (a federated sign-in) is not followed: the flow starts again and says to choose another option. A flow that cannot go on starts again once, then ends the re-sign-in. Closing the dialog rejects with …-REAUTHENTICATION-CN01.
  • ChangeCredential has an optional current-value field (hint: "Leave this empty if you have not set one yet."). ChangeCredential and UserProfile use runWithStepUp. When the app sets onReauthenticationRequired (Vue: @reauthentication-required), they call it instead and do not retry.
  • updateMeProfile uses the SDK's HTTP client fetcher, so a 401 reaches the step-up handling instead of a generic error.

Server SDKs

  • @thunderid/nextjs and @thunderid/nuxt hold the session on the server, so they do not sign the user in again in the page; their reauthenticate rejects (Nuxt: NUXT-REAUTHENTICATION-UM01).
    • ChangeCredential has the current-value field. ChangeCredential and UserProfile show "Sign in again to save this change." on a step-up and pass the challenge to onReauthenticationRequired (Nuxt: the reauthentication-required event). updateUserProfileAction and Nuxt's PATCH /api/auth/user/profile return the challenge.
    • A redirect sign-in forwards max_age and prompt=login (Next.js signInAction, Nuxt GET /api/auth/signin and the plugin's signIn(options)), so the app can sign the user in again and the user saves once more. With either option, Next.js starts a new session for the sign-in, as Nuxt does, so a signed-in user's callback replaces the session cookie. Other options are not sent on a redirect sign-in, and a payload with executionId, applicationId or flowType still starts the embedded flow.
  • @thunderid/node and @thunderid/express: the new payload.

Not covered here:

  • The browser and Express quickstarts in thunder-id/samples have their own credential forms that send the old body, so the e2e specs that drive them fail until the samples change lands.
  • Next.js and Nuxt are covered by unit tests; the runtime check below uses React.

Known follow-ups: thunder-id/thunderid#7122 (sign in again within the session's organization unit) and thunder-id/thunderid#7123 (use PAR for the popup when the server requires it).

Proof

Run against a server built from thunderid main with #7086 (make run, 180 s recent sign-in window), with a React page served from this branch and driven by Playwright in Chrome.

Every check passed: 11 in redirect mode, 13 in embedded mode. The user's last sign-in was more than 180 s old for every case below except the held password.

Case Redirect mode (popup) Embedded mode (dialog)
Held password: missing current value 400, wrong 403, right 204. No re-sign-in. same result, from a session whose access token is at+jwt
First PIN: 401, sign in again, the change is sent once more and saved (204), newer auth_time for the same sub
Email change in UserProfile: 401, sign in again, PUT /users/me 200
Blocked popup / closed dialog The form asks to allow pop-ups; the next submit signs in first and sends the change once. The change is not sent again and nothing is saved.
Another account signs in Refused, the session's tokens stay. Refused, the session's tokens stay.

In embedded mode the dialog starts the flow with {"flowType":"AUTHENTICATION","maxAge":180}, the maxAge from the challenge.

Run logs
17:01:31 R1 held password: missing, wrong, then the right current value
17:01:34   [r1] POST /users/me/update-credentials -> 400
17:01:34 PASS R1 missing current value shows on the current field
17:01:34   [r1] POST /users/me/update-credentials -> 403
17:01:34 PASS R1 wrong current value shows on the current field
17:01:34   [r1] POST /users/me/update-credentials -> 204
17:01:34 PASS R1 right current value changes the password
17:01:43 signed in r2..r5; waiting for the 180 s window (auth_time 1795798896)
17:04:41 R2 first PIN after the window: popup re-sign-in and one retry
17:04:41   [r2] POST /users/me/update-credentials -> 401
17:04:41   [sdkjs-r2] popup opened
17:04:42   [r2] POST /users/me/update-credentials -> 204
17:04:42 PASS R2 PIN set after the re-sign-in
17:04:42 PASS R2 session holds a newer sign-in for the same user (auth_time 1795798896 -> 1795799082)
17:04:43 R3 email change in UserProfile after the window
17:04:43   [r3] PUT /users/me -> 401
17:04:43   [sdkjs-r3] popup opened
17:04:44   [r3] PUT /users/me -> 200
17:04:44 PASS R3 email saved after the re-sign-in
17:04:44 R4 blocked popup, then a second submit
17:04:45   [r4] POST /users/me/update-credentials -> 401
17:04:45 PASS R4 blocked popup asks to allow pop-ups
17:04:45   [sdkjs-r4] popup opened
17:04:46   [r4] POST /users/me/update-credentials -> 204
17:04:46 PASS R4 second submit signs in first, then saves
17:04:46 PASS R4 the second submit sent the change once, after the sign-in (1 request)
17:04:46 R5 a different account in the popup
17:04:47   [r5] POST /users/me/update-credentials -> 401
17:04:47   [sdkjs-other] popup opened
17:04:48 PASS R5 different account refused
17:04:48 PASS R5 session tokens unchanged
17:04:48 ALL PASSED

17:04:49 E1 held password in embedded mode: missing, wrong, then the right current value
17:04:50   [e1] POST /oauth2/token -> 200
17:04:50 PASS E1 the session holds an access token (typ at+jwt), not the flow assertion
17:04:50   [e1] POST /users/me/update-credentials -> 400
17:04:50 PASS E1 missing current value shows on the current field
17:04:50   [e1] POST /users/me/update-credentials -> 403
17:04:50 PASS E1 wrong current value shows on the current field
17:04:50   [e1] POST /users/me/update-credentials -> 204
17:04:50 PASS E1 right current value changes the password
17:04:50 PASS E1 no dialog: the current value is enough
17:04:51   [e2] POST /oauth2/token -> 200
17:04:52   [e3] POST /oauth2/token -> 200
17:04:53   [e4] POST /oauth2/token -> 200
17:04:54   [e5] POST /oauth2/token -> 200
17:04:54 signed in e2..e5; waiting for the 180 s window (auth_time 1795799091)
17:07:56 E2 first PIN after the window: dialog re-sign-in and one retry
17:07:56   [e2] POST /users/me/update-credentials -> 401
17:07:56   [e2] POST /flow/execute {"flowType":"AUTHENTICATION","maxAge":180} -> 200
17:07:56   dialog open, signing in as sdkjs-e2
17:07:56   [e2] POST /oauth2/token -> 200
17:07:56   [e2] POST /users/me/update-credentials -> 204
17:07:56 PASS E2 PIN set after the re-sign-in
17:07:56 PASS E2 session holds a new access token for the same user (auth_time 1795799091 -> 1795799276)
17:07:56 PASS E2 dialog closed
17:07:56 E3 email change in UserProfile after the window
17:07:56   [e3] PUT /users/me -> 401
17:07:56   [e3] POST /flow/execute {"flowType":"AUTHENTICATION","maxAge":180} -> 200
17:07:56   dialog open, signing in as sdkjs-e3
17:07:56   [e3] POST /oauth2/token -> 200
17:07:56   [e3] PUT /users/me -> 200
17:07:56 PASS E3 email saved after the re-sign-in
17:07:56 E4 the user closes the dialog
17:07:56   [e4] POST /users/me/update-credentials -> 401
17:07:56   [e4] POST /flow/execute {"flowType":"AUTHENTICATION","maxAge":180} -> 200
17:07:58 PASS E4 the change was not sent again after closing (1 request)
17:07:58 PASS E4 PIN not saved
17:07:58 E5 a different account in the dialog
17:07:58   [e5] POST /users/me/update-credentials -> 401
17:07:58   [e5] POST /flow/execute {"flowType":"AUTHENTICATION","maxAge":180} -> 200
17:07:58   dialog open, signing in as sdkjs-other
17:07:58 PASS E5 different account refused
17:07:58 PASS E5 session tokens unchanged
17:07:59 ALL PASSED

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.
  • Cross-SDK parity. Exactly one of parity/prs-raised or parity/prs-not-needed added.
    • If parity/prs-raised, the port links are posted as a reply on the parity check's comment.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

A completed embedded sign-in, sign-up or organization unit switch
returns a flow assertion. Exchange it at the token endpoint (RFC 8693,
subject token type JWT, no scope) for an access token and replace the
session with it, keeping the assertion as the ID token. One core
method, exchangeFlowAssertion, serves the React and Vue clients, the
browser organization unit switch, the Next.js sign-in action and the
Nuxt sign-in route.

Embedded mode now needs clientId, checked at initialization, and the
application needs the token exchange grant; without it the sign-in
fails with an error that names the grant and keeps no session.

Signed-off-by: PasinduYeshan <[email protected]>
- When the assertion exchange fails, drop the SSO session handles the
  completing step returned, so a retry shows the flow again, and report
  the failure to the sign-in-failed hook.
- Check clientId after the client is set up, and end the wait of every
  caller when initialization is refused.
- Stop the previous session's refresh timer when an embedded session
  replaces it.
- Take the session identity from the new assertion in the Next.js
  sign-in action and in the Nuxt session cookie, not from an ID token
  stored for the same session ID.

Signed-off-by: PasinduYeshan <[email protected]>
The release commit left changelog lines that format:check rejects, which fails the PR builder.

Signed-off-by: PasinduYeshan <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 120 files, which is 20 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This organization's CodeRabbit subscription is cancelled. Resubscribe in Billing to continue reviews beyond the free-tier limit.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 49ec57c and 9adc16f.

Files selected for processing: 120

  • packages/browser/CHANGELOG.md
  • packages/browser/src/ThunderIDBrowserClient.ts
  • packages/browser/src/__tests__/ThunderIDBrowserClient.organizationUnit.test.ts
  • packages/browser/src/__tests__/ThunderIDBrowserClient.reauthentication.test.ts
  • packages/browser/src/__tests__/ThunderIDBrowserClient.test.ts
  • packages/browser/src/utils/__tests__/createHttpClientFetcher.test.ts
  • packages/browser/src/utils/createHttpClientFetcher.ts
  • packages/browser/src/utils/reauthenticationPopup.ts
  • packages/express/src/ThunderIDExpressClient.ts
  • packages/express/src/__tests__/ThunderIDExpressClient.test.ts
  • packages/javascript/CHANGELOG.md
  • packages/javascript/src/ThunderIDJavaScriptClient.ts
  • packages/javascript/src/__tests__/AuthenticationHelper.test.ts
  • packages/javascript/src/__tests__/ThunderIDJavaScriptClient.reauthentication.test.ts
  • packages/javascript/src/__tests__/ThunderIDJavaScriptClient.session.test.ts
  • packages/javascript/src/api/account/__tests__/updateMeCredentials.test.ts
  • packages/javascript/src/api/account/__tests__/updateMeProfile.test.ts
  • packages/javascript/src/api/account/updateMeCredentials.ts
  • packages/javascript/src/api/account/updateMeProfile.ts
  • packages/javascript/src/errors/StepUpRequiredError.ts
  • packages/javascript/src/errors/ThunderIDAPIError.ts
  • packages/javascript/src/i18n/models/i18n.ts
  • packages/javascript/src/i18n/translations/en-US.ts
  • packages/javascript/src/i18n/translations/fr-FR.ts
  • packages/javascript/src/i18n/translations/hi-IN.ts
  • packages/javascript/src/i18n/translations/ja-JP.ts
  • packages/javascript/src/i18n/translations/pt-BR.ts
  • packages/javascript/src/i18n/translations/pt-PT.ts
  • packages/javascript/src/i18n/translations/si-LK.ts
  • packages/javascript/src/i18n/translations/ta-IN.ts
  • packages/javascript/src/i18n/translations/te-IN.ts
  • packages/javascript/src/index.ts
  • packages/javascript/src/models/api.ts
  • packages/javascript/src/models/embedded-signin-flow.ts
  • packages/javascript/src/models/reauthentication.ts
  • packages/javascript/src/models/session.ts
  • packages/javascript/src/utils/AuthenticationHelper.ts
  • packages/javascript/src/utils/__tests__/mapCredentialUpdateError.test.ts
  • packages/javascript/src/utils/__tests__/parseAuthenticationChallenge.test.ts
  • packages/javascript/src/utils/__tests__/pickRecentSignInParams.test.ts
  • packages/javascript/src/utils/__tests__/runWithStepUp.test.ts
  • packages/javascript/src/utils/createApiResponseError.ts
  • packages/javascript/src/utils/mapCredentialUpdateError.ts
  • packages/javascript/src/utils/mapReauthenticationError.ts
  • packages/javascript/src/utils/parseAuthenticationChallenge.ts
  • packages/javascript/src/utils/pickRecentSignInParams.ts
  • packages/javascript/src/utils/runWithStepUp.ts
  • packages/nextjs/CHANGELOG.md
  • packages/nextjs/src/ThunderIDNextClient.ts
  • packages/nextjs/src/client/components/account/ChangeCredential/ChangeCredential.tsx
  • packages/nextjs/src/client/components/account/UserProfile/UserProfile.tsx
  • packages/nextjs/src/client/contexts/ThunderID/ThunderIDProvider.tsx
  • packages/nextjs/src/server/actions/account/__tests__/updateUserProfileAction.test.ts
  • packages/nextjs/src/server/actions/account/updateUserCredentialsAction.ts
  • packages/nextjs/src/server/actions/account/updateUserProfileAction.ts
  • packages/nextjs/src/server/actions/auth/__tests__/signInAction.test.ts
  • packages/nextjs/src/server/actions/auth/signInAction.ts
  • packages/nextjs/src/server/actions/auth/switchOrganizationUnitAction.ts
  • packages/node/src/ThunderIDNodeClient.ts
  • packages/node/src/__tests__/ThunderIDNodeClient.test.ts
  • packages/nuxt/CHANGELOG.md
  • packages/nuxt/src/runtime/components/ThunderIDRoot.ts
  • packages/nuxt/src/runtime/components/account/ChangeCredential.ts
  • packages/nuxt/src/runtime/components/account/UserProfile.ts
  • packages/nuxt/src/runtime/plugins/thunderid.ts
  • packages/nuxt/src/runtime/server/ThunderIDNuxtClient.ts
  • packages/nuxt/src/runtime/server/routes/auth/session/signin.get.ts
  • packages/nuxt/src/runtime/server/routes/auth/session/signin.post.ts
  • packages/nuxt/src/runtime/server/routes/auth/user/credentials.patch.ts
  • packages/nuxt/src/runtime/server/routes/auth/user/profile.patch.ts
  • packages/nuxt/src/runtime/server/utils/session.ts
  • packages/nuxt/tests/unit/profile-patch.test.ts
  • packages/nuxt/tests/unit/session-manager.test.ts
  • packages/nuxt/tests/unit/signin-get-organization-unit.test.ts
  • packages/nuxt/tests/unit/signin-post.test.ts
  • packages/react-router/CHANGELOG.md
  • packages/react/CHANGELOG.md
  • packages/react/src/ThunderIDReactClient.ts
  • packages/react/src/__tests__/ThunderIDReactClient.flowSessions.test.ts
  • packages/react/src/api/account/__tests__/updateMeProfile.test.ts
  • packages/react/src/api/account/updateMeProfile.ts
  • packages/react/src/components/account/ChangeCredential/BaseChangeCredential.tsx
  • packages/react/src/components/account/ChangeCredential/ChangeCredential.tsx
  • packages/react/src/components/account/ChangeCredential/__tests__/ChangeCredential.test.tsx
  • packages/react/src/components/account/UserProfile/UserProfile.tsx
  • packages/react/src/components/account/UserProfile/__tests__/UserProfile.test.tsx
  • packages/react/src/components/auth/Reauthentication/ReauthenticationDialog.tsx
  • packages/react/src/components/auth/Reauthentication/__tests__/ReauthenticationDialog.test.tsx
  • packages/react/src/contexts/ThunderID/ThunderIDContext.ts
  • packages/react/src/contexts/ThunderID/ThunderIDProvider.tsx
  • packages/react/src/contexts/ThunderID/__tests__/ThunderIDProvider.test.tsx
  • packages/tanstack-router/CHANGELOG.md
  • packages/vue/CHANGELOG.md
  • packages/vue/src/ThunderIDVueClient.ts
  • packages/vue/src/__tests__/api/account/update-me-credentials.test.ts
  • packages/vue/src/__tests__/api/account/update-me-profile.test.ts
  • packages/vue/src/__tests__/client/ThunderIDVueClient.test.ts
  • packages/vue/src/__tests__/components/account/change-credential.test.ts
  • packages/vue/src/__tests__/components/account/user-profile-step-up.test.ts
  • packages/vue/src/__tests__/providers/ThunderIDProvider.organization-unit.test.ts
  • packages/vue/src/__tests__/providers/ThunderIDProvider.reauthentication.test.ts
  • packages/vue/src/api/account/updateMeProfile.ts
  • packages/vue/src/components/account/change-credential/BaseChangeCredential.ts
  • packages/vue/src/components/account/change-credential/ChangeCredential.ts
  • packages/vue/src/components/account/user-profile/UserProfile.ts
  • packages/vue/src/components/auth/reauthentication/ReauthenticationDialog.css.ts
  • packages/vue/src/components/auth/reauthentication/ReauthenticationDialog.ts
  • packages/vue/src/components/primitives/PasswordField/PasswordField.css.ts
  • packages/vue/src/components/primitives/PasswordField/PasswordField.ts
  • packages/vue/src/models/contexts.ts
  • packages/vue/src/providers/ThunderIDProvider.ts
  • packages/vue/src/styles/injectStyles.ts
  • playgrounds/node/src/catalog.ts
  • playgrounds/node/src/operations.ts
  • playgrounds/vue/src/pages/explorer/stories.ts
  • tests/e2e/pages/thunderid-web-sample.page.ts
  • tests/e2e/tests/nextjs-quickstart/change-credential.spec.ts
  • tests/e2e/tests/nuxt-quickstart/change-credential.spec.ts
  • tests/e2e/tests/react-quickstart/change-credential.spec.ts
  • tests/e2e/tests/vue-quickstart/change-credential.spec.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🔀 Cross-SDK feature parity, ports raised

This pull request is labelled parity/prs-raised, so the capability it introduces is expected in the other ThunderID SDKs as well.

Ports (DO NOT EDIT)

  • thunder-id/ios-sdks, iOS => #61
  • thunder-id/android-sdks, Android => #70
  • thunder-id/flutter-sdks, Flutter => #83

3 of 3 sibling SDKs accounted for.

Every sibling SDK is accounted for.

The contract is in the SDK development specification.

POST /users/me/update-credentials takes {name, currentValue, newValue}. A credential the user
holds needs its current value. One the user does not hold yet, and an email or mobile change,
needs a recent sign-in: the server answers 401 with an insufficient_user_authentication
challenge and max_age.

The SDKs send the new body, show the current-value errors on the current-value field, and turn
the challenge into a StepUpRequiredError with maxAge. ChangeCredential and UserProfile sign the
user in again and send the change once more: a popup for a redirect session, the sign-in flow
in a dialog for an embedded session. Next.js and Nuxt hold the session on the server: their
components pass the challenge to the app, and a redirect sign-in forwards max_age and
prompt=login.

Signed-off-by: PasinduYeshan <[email protected]>
@PasinduYeshan

Copy link
Copy Markdown
Contributor Author

@PasinduYeshan PasinduYeshan added Type/New Feature parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there labels Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity/prs-raised Ports exist in the other SDKs, or are recorded as not applying there Type/New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant