teamhanko / hanko

Authentication and user management for the passkey era.
https://hanko.io
Other
5.67k stars 794 forks source link

feat(flow-api): enable webauthn login with conditional mediation #1384

Closed lfleischmann closed 5 months ago

lfleischmann commented 6 months ago

Description

Enables the flow API to handle WebAuthn/passkey logins with conditional mediation.

Implementation

Tests

I have updated the generic_client in the backend/flow-api/static directory so you should be able to test this with it.

TODO

Because the send_capabilities check is used on all (non sub-)flows the mediation input is also present in flows where it is not relevant, i.e. registration and profile. Because Flows / FlowModels do not have any sort of "name" that generalizes over actual instances of a flow (which means: instances have IDs but I cannot use that in this scenario because they differ from instance to instance ...) there is no way to know what flow an action/hook is actually executed in during initialization of an action (or during execution/finalization for that matter ...). This means there is currently no clear cut way to determine that the conditional mediation input in the preflight state should be omitted on registration and profile flows.