Class ValidateWebAuthnAssertion
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.authn.AbstractAuthenticationAction
net.shibboleth.idp.authn.AbstractValidationAction
net.shibboleth.idp.authn.impl.AbstractAuditingValidationAction
net.shibboleth.idp.plugin.authn.webauthn.impl.ValidateWebAuthnAssertion
- All Implemented Interfaces:
PrincipalSupportingComponent,Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
An action that validates a WebAuthn authenticator assertion that results from a call to WebAuthn's 'get' credential
API. If successful, populates the Subject with a
UsernamePrincipal based on the username in
the authentication context and a WebAuthnUserIdPrinicpal based on the user.id in the authentication context.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA default cleanup hook that removes theWebAuthnAuthenticationContextfrom the tree. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate WebAuthnAuthenticationContextThe WebAuthn authentication context.private WebAuthnCredentialRepositoryThe credential repository to store valid credentials in.private final org.slf4j.LoggerClass logger.private com.yubico.webauthn.data.PublicKeyCredentialRequestOptionsThe options used to create the authentication request.private Predicate<ProfileRequestContext>Should we update the signature count on the credential in the repository after successful validation? Defaults to true.private WebAuthnAuthenticationClientThe WebAuthn client to use.private final Function<ProfileRequestContext,WebAuthnAuthenticationContext> Strategy used to locate or create theWebAuthnAuthenticationContextto populate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildAuthenticationResult(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected SubjectpopulateSubject(Subject subject) voidsetCredentialRepository(WebAuthnCredentialRepository repository) Set the credential repository used to store WebAuthn credentials.voidsetUpdateSignatureCount(boolean flag) Set the flag to determine if we should update the signature count on the credential in the repository after successful validation?voidSet the predicate to determine if we should update the signature count on the credential in the repository after successful validation?voidSet the WebAuthn client used to handle validation of the authentication ceremony.private voidupdateSignatureCount(String username, com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAssertionResponse, com.yubico.webauthn.data.ClientAssertionExtensionOutputs> assertion) Take the new signature count from the authenticator assertion response and update the stored credential with that value.Methods inherited from class net.shibboleth.idp.authn.impl.AbstractAuditingValidationAction
doAudit, doExecute, getAuditContext, getAuditFields, recordFailure, recordSuccess, setAuditContextCreationStrategy, setPopulateAuditContextAction, setWriteAuditLogActionMethods inherited from class net.shibboleth.idp.authn.AbstractValidationAction
addDefaultPrincipals, getClassifiedErrors, getCleanupHook, getMetricName, getRequesterLookupStrategy, getResponderLookupStrategy, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, setAddDefaultPrincipals, setClassifiedMessages, setCleanupHook, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipalsMethods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, setAuthenticationContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
webauthnContextLookupStrategy
@Nonnull private final Function<ProfileRequestContext,WebAuthnAuthenticationContext> webauthnContextLookupStrategyStrategy used to locate or create theWebAuthnAuthenticationContextto populate. -
context
The WebAuthn authentication context. -
webAuthnClient
The WebAuthn client to use. -
credentialRepository
The credential repository to store valid credentials in. -
publicKeyCredentialRequestOptions
@NonnullBeforeExec private com.yubico.webauthn.data.PublicKeyCredentialRequestOptions publicKeyCredentialRequestOptionsThe options used to create the authentication request. -
updateSignatureCount
Should we update the signature count on the credential in the repository after successful validation? Defaults to true.
-
-
Constructor Details
-
ValidateWebAuthnAssertion
public ValidateWebAuthnAssertion()Constructor.
-
-
Method Details
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
setCredentialRepository
Set the credential repository used to store WebAuthn credentials.- Parameters:
repository- The repository to set.
-
setWebAuthnClient
Set the WebAuthn client used to handle validation of the authentication ceremony.- Parameters:
client- The webauthnClient to set.
-
setUpdateSignatureCount
public void setUpdateSignatureCount(boolean flag) Set the flag to determine if we should update the signature count on the credential in the repository after successful validation?- Parameters:
flag- The flag to set.
-
setUpdateSignatureCountPredicate
Set the predicate to determine if we should update the signature count on the credential in the repository after successful validation?- Parameters:
predicate- The predicate to set.
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doPreExecutein classAbstractValidationAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doExecutein classAbstractAuthenticationAction
-
updateSignatureCount
private void updateSignatureCount(@Nonnull String username, @Nonnull com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAssertionResponse, com.yubico.webauthn.data.ClientAssertionExtensionOutputs> assertion) throws AssertionFailureExceptionTake the new signature count from the authenticator assertion response and update the stored credential with that value. It is assumed the assertion and signature counter is valid by the time this method is called.- Parameters:
username- the username of the user to update signature count forassertion- the assertion with the credential Id to update, and the new signature count- Throws:
AssertionFailureException- on error updating the counter
-
buildAuthenticationResult
protected void buildAuthenticationResult(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
buildAuthenticationResultin classAbstractValidationAction
-
populateSubject
- Specified by:
populateSubjectin classAbstractValidationAction
-