Skip to content

SDKs: application-initiated actions (requiredAction, kcActionStatus) and sign-out of other devices - #43

Merged
pnzrr merged 10 commits into
mainfrom
jp/kc-action-sdks
Nov 22, 2026
Merged

pnzrr merged 10 commits into
mainfrom
jp/kc-action-sdks

Conversation

@pnzrr

@pnzrr pnzrr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

SDK side of spec/21 for iOS, Android, React Native and Flutter. Stacked on #41 (the server change); retarget to main once #41 merges.

API (same shape on every platform)

  • kc.authentication.requiredAction("UPDATE_PASSWORD", maxAge:): a step-up with kc_action using the stored post-login session. Re-authentication follows the realm's Maximum Age of Authentication for the action; maxAge: 0 always asks for the factors again.
  • LoginParameters.kcAction (reserved field).
  • kcActionStatus (success / cancelled / error, unknown values kept): on the flow after it is authorized (iOS flow.kcActionStatus, Android flow.kcActionStatus, RN flow.kcActionStatus and the authorized step / NativeLoginResult, Flutter AuthorizedStep / NativeLoginAuthorized / flow.kcActionStatus). Also set after the browser fallback, from the callback's kc_action_status, when the action has no native variant.
  • update_password: logoutOtherSessions on the params (the server's suggested default; absent from older servers) and on the answer (sent only when set).

Default screens (SwiftUI, Compose, React, Flutter): "Sign out of other devices" switch when offered (on by default); when the app asked for the change (the descriptor is skippable): a Cancel button that sends action=skip and a neutral subtitle. New strings in English and German.

Bridges: RN (both native modules) and Flutter (Pigeon regenerated: LoginParametersMessage.kcAction, FlowStepMessage.kcActionStatus, AnswerMessage.logoutOtherSessions, CredentialsMessage.kcActionStatus) map the new fields.

Tests: every platform replays the KcActionIT transcripts from #41: password change right after sign-in with sign-out of other devices, the realm's max auth age forcing re-authentication, max_age=0 + cancel, actions that report error, and an action without a native variant completed through the browser fallback with the callback's status.

  • iOS: 131 core + 14 UI tests pass (swift test).
  • Android: core and ui unit tests pass, incl. KcActionReplayTest (6).
  • React Native: 165 Jest tests, typecheck and lint pass.
  • Flutter: 46 tests and flutter analyze pass.
  • Not run locally: the RN/Flutter native bridge code compiles only inside the example apps; CI builds them.

Docs: a "Change password and other application-initiated actions" section in each integration guide; a row in the README's "What runs natively" table and the ROADMAP's done list; Flutter changelog.

@pnzrr
pnzrr requested a review from xgp November 20, 2026 14:21
Base automatically changed from jp/kc-action to main November 22, 2026 08:51
@pnzrr
pnzrr force-pushed the jp/kc-action-sdks branch from f8387c0 to 0f6c9d3 Compare November 22, 2026 08:52
pnzrr added 10 commits November 22, 2026 09:01
…nd sign-out of other devices

- LoginParameters.kcAction (kc_action, reserved field) and Authentication.requiredAction(_:maxAge:) — a step-up with kc_action; NativeLoginFlow.kcActionStatus reports success, cancelled or error after .authorized.
- UpdatePasswordParams.logoutOtherSessions and ChallengeAnswer.updatePassword(_:confirm:logoutOtherSessions:) (sent only when set).
- Default update_password screen: 'Sign out of other devices' toggle when offered, Cancel and a neutral subtitle when the app asked for the change (skippable); en/de strings.
- KcActionReplayTests replay the KcActionIT transcripts; integration guide section.
…s) and sign-out of other devices

- LoginParameters.kcAction (kc_action, reserved field) and Authentication.requiredAction — a step-up with kc_action; NativeLoginFlow.kcActionStatus (KcActionStatus) after Authorized.
- UpdatePasswordParams.logoutOtherSessions and ChallengeAnswer.UpdatePassword(logoutOtherSessions = …) (sent only when set).
- Default update_password screen: 'Sign out of other devices' switch when offered, Cancel and a neutral subtitle when the app asked for the change; en/de strings.
- KcActionReplayTest (twin of the iOS tests) replays the KcActionIT transcripts; integration guide section.
…Status) and sign-out of other devices

- LoginParameters.kcAction and authentication.requiredAction(alias, parameters) — a step-up with kc_action through both native bridges.
- The authorized step and NativeLoginResult carry kcActionStatus; KcActionStatus type.
- UpdatePasswordParams.logoutOtherSessions and the updatePassword answer's logoutOtherSessions (mapped by both bridges, sent only when set).
- Default update_password screen: 'Sign out of other devices' switch when offered, Cancel (was 'Not now') and a neutral subtitle when the app asked for the change; en/de strings.
- kcAction.test.ts replays the KcActionIT transcripts through TranscriptNative (taught kc_action, the status and the sign-out field); integration guide section.
…s) and sign-out of other devices

- Pigeon: LoginParametersMessage.kcAction, FlowStepMessage.kcActionStatus, AnswerMessage.logoutOtherSessions (regenerated); both native plugins map them.
- LoginParameters.kcAction and Authentication.requiredAction(alias, maxAge:) — a step-up with kc_action; KcActionStatus on AuthorizedStep and NativeLoginAuthorized.
- UpdatePasswordChallenge.logoutOtherSessions and ChallengeAnswer.updatePassword(logoutOtherSessions:); the default screen offers 'Sign out of other devices' and, when the app asked for the change, Cancel and a neutral subtitle (en/de).
- kc_action_test.dart replays the KcActionIT transcripts; the transcript host learned step-ups (the stored post-login auth_session). Integration guide section and changelog.
@pnzrr
pnzrr force-pushed the jp/kc-action-sdks branch from 0f6c9d3 to f0b8ed8 Compare November 22, 2026 09:01
@pnzrr
pnzrr merged commit 16f05bf into main Nov 22, 2026
12 checks passed
@pnzrr
pnzrr deleted the jp/kc-action-sdks branch November 22, 2026 09:10
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