Class AllowCurrentUserAccessPredicate

All Implemented Interfaces:
Predicate<ProfileRequestContext>, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

public class AllowCurrentUserAccessPredicate extends AbstractIdentifiableInitializableComponent implements Predicate<ProfileRequestContext>
An access control predicate that should implement comparison logic to allow access only to authenticated users who initiated the WebAuthn registration/authentication process. If the authenticated user is not the same as the user who started the registration/authentication process (as determined by the initial username collection step), access should be denied.

It is important to prevent users from changing their username between the registration and authentication flows. If this is allowed, it would create a loophole in the WebAuthn authentication process which could allow a user bypass. For instance, a user who starts the registration of a new WebAuthn credential, without any previous WebAuthn credentials, could then login with an inferior authentication mechanism as another user who should only be using WebAuthn (although the overall flow is the responsibility of the MFA flow logic).

More complicated comparison predicates might be needed if either the principal in the subject context and or the username in the registration context have been transformed into different forms but are still logically equivalent.