IS-11302: Auto-start WebAuthn ceremonies with a single action#158
Conversation
When an authentication or registration step renders exactly one WebAuthn client-operation action, automatically trigger the ceremony so the user goes straight to the OS prompt without an extra click. Toggleable via HaapiStepperConfig.webAuthnAutostart (default true). Auto-start is skipped when: - The browser doesn't expose the WebAuthn JSON parsing API. - The user agent is real Safari (non-Chromium) — Safari blocks auto-initiated credentials calls when the document isn't focused; matches the Velocity templates' UA sniff. - A platform-only any-device registration is offered but no platform authenticator is available. - An any-device step has been split by splitWebAuthnRegistrationAction into both platform and cross-platform actions (the user must pick). Also adds the platformCredentials / crossPlatformCredentials descriptor lists to HaapiWebAuthnAuthenticationArgs to match the HAAPI data model.
luisgoncalves
left a comment
There was a problem hiding this comment.
I tested a few combinations locally and this seems to work well 👍
I commented with some concerns, and other smaller things for consideration.
| * | ||
| * * bankid | ||
| * * encap-auto-activation | ||
| * * encap-auto-activation (deprecated) |
There was a problem hiding this comment.
Ah, right. This was removed in server version 11.0. Since the LWA will released after that, I suggest removing this mention here. The HAAPI docs will be updated at some point.
|
|
||
| case HAAPI_STEPS.AUTHENTICATION: | ||
| case HAAPI_STEPS.REGISTRATION: | ||
| return handleAuthenticationOrRegistrationStep(nextStepResponse, nextStep, config); |
There was a problem hiding this comment.
The stepper already has "automatic handling" of certain cases, namely redirect steps and OAuth responses. In those cases we either trigger the automatic behavior (e.g. redirect to application), or don't do anything, and the "next step data" goes through to be set on the stepper context.
Here, however, both things are done: trigger the automatic behavior and still set "next step data" on the context, which means it will be rendered, but we have no idea how it will be rendered. An interceptor doesn't get the chance to do something about this, without further change to the config option.
I'm wondering if this wouldn't be better suited in a component - namely in a component specific to each WebAuthn client operation. OTOH here we are in the "transition moment", so we know when to start - that may be a plus, not sure...
Did you consider this?
|
|
||
| render( | ||
| <HaapiStepper> | ||
| <TestComponent /> |
There was a problem hiding this comment.
This kind of shows the concern in my other comment. This has nothing about webauthn on rendering, but something already started in the background, anyway.
|
|
||
| case HAAPI_STEPS.AUTHENTICATION: | ||
| case HAAPI_STEPS.REGISTRATION: | ||
| return handleAuthenticationOrRegistrationStep(nextStepResponse, nextStep, config); |
There was a problem hiding this comment.
Somewhat related to the above, in the Velocity version, when there is a "auto start", the UI hides the buttons and shows a spinner (both on authentication and registration). I guess interaction with the page is blocked while the native browser UI is present, but maybe it's good to adjust the UI below, anyway. Question for Urban, maybe.
|
The Register new device screens is missing a page title. Could be it's lacking in Velocity also. |
Jira: https://curity.atlassian.net/browse/IS-11302
Summary
When an authentication or registration step renders exactly one WebAuthn client-operation action, automatically trigger the ceremony so the user goes straight to the OS prompt without an extra click. Toggleable via
HaapiStepperConfig.webAuthnAutostart(defaulttrue).Auto-start is skipped when:
splitWebAuthnRegistrationActioninto both platform and cross-platform actions (the user must pick).Also extends
HaapiWebAuthnAuthenticationArgswith theplatformCredentials/crossPlatformCredentialsdescriptor lists to match the HAAPI data model.Architecture
manageWebAuthnAutoStart(step, nextStep)— pure helper, gates and dispatches.handleAuthenticationOrRegistrationStep— step handler that formats data and fires the helper whenconfig.webAuthnAutostart && isWebAuthnStep(step).webauthn/utils.ts.Out of scope (follow-ups)
errorActionsonly for user clicks. Plan drafted, will land as a separate PR (likely IS-11252).Test plan