Add WebAuthn authentication module #260
Open
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.
This PR implements passkey support backed by WebAuthn, addressing #259 by introducing a new
wrenam-auth-webauthnauthentication module and integrating it with the existing device/profile/REST/UI infrastructure.At a high level, the PR adds:
Two authentication modules:
WebAuthnperforms authentication and supports both passkey (username-less) and username-based WebAuthn flows.WebAuthnRegistration– performs credential registration for authenticated users.Device profile persistence for WebAuthn credentials:
WebAuthnDeviceSettingsmodeled after the WebAuthn credential record (credentialId, public key, transports, signCount, backup flags, attestation object, etc.).WebAuthnDeviceProfileManagerand a newWebAuthnSMS/REST service (WebAuthnService,WebAuthnServiceFactory) that store profiles in a dedicated user attribute (webAuthnDeviceProfiles), with optional encryption via the existingEncryptedDeviceStoragemechanism.webAuthnDeviceProfilesandwebAuthnDeviceProfilesContainer, plus idRepo configuration so the attribute is available on user entries and exposed as a readable attribute (entryUUIDis also made available for use as user handle).A REST API for managing WebAuthn devices:
WebAuthnDevicesDaoandWebAuthnDevicesResourceunder/json/users/{user}/devices/webauthn, wired throughCoreRestDevicesGuiceModuleandCoreRestRouteProvider.UserDevicesDao/UserDevicesResourcenow generic over service type) to support WebAuthn alongside OATH, push, and trusted devices.UI integration:
WebAuthnDeviceService.jsmand updates toAuthenticationDevicesViewso WebAuthn devices appear alongside OATH/push devices, with delete and details actions.DeviceDetailsDialogand related templates updated to handle WebAuthn devices (no recovery codes, different type marker).WebAuthn3.htmlandWebAuthnRegistration2.htmlfor the “waiting on authenticator” stages, matching the existing AM login UX.Core wiring and upgrade support:
amAuth.xml,serviceNames.properties,serviceNames/schemaNames.properties,debugfiles.properties, and test datastore settings updated to register the new modules, SMS services, debug log, and schema.AuthServiceHelperandDirectoryContentUpgraderextended so the new modules and WebAuthn device schema are added on upgrade.AMAuthConfigUtils/ISAuthConstantsextended with a Wren-specific auth-level prefix (wrensec-am-auth-…-auth-level) so the WebAuthn modules’ auth levels are picked up consistently.