Class StorePublicKeyCredential

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action

public class StorePublicKeyCredential extends AbstractWebAuthnAuditingAction<WebAuthnRegistrationContext>
An action that adds the public key credential in the registration context to the credential repository.

Importantly, the registration is stored against the username in the context (the authenticated user), not the WebAuthn user.name. This way, even if the user changed the webauthn create request in the browser (e.g. to a different userId), it will still be registered against the authenticated user. This prevents a user from registering a credential against somebody else's account.

Event:
{WebAuthnRegistrationEventIds#INVALID_REGISTRATION}
Precondition:
ProfileRequestContext.getSubcontext(WebAuthnRegistrationContext.class) != null
Postcondition:
the credential from the registration context is added to the credential repository