Class YubicoWebauthnClientFactory
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.webauthn.client.impl.YubicoWebauthnClientFactory
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,FactoryBean<WebAuthnAuthenticationClient>
@ThreadSafe
public class YubicoWebauthnClientFactory
extends AbstractInitializableComponent
implements FactoryBean<WebAuthnAuthenticationClient>
Spring factory bean for creating a
YubicoWebAuthnAuthenticationClient.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanAllow unrestricted origin ports? Default is false.private booleanAllow subdomains in origins? Default is false.private booleanShould we allow an untrusted attestation?private com.yubico.webauthn.CredentialRepositoryThe credential repository to store valid credentials in.private com.yubico.fido.metadata.FidoMetadataServiceIf configured, a FIDO metadata service resolver.private final org.slf4j.LoggerClass logger.Allowable origins the authenticator response can contain.private List<com.yubico.webauthn.data.PublicKeyCredentialParameters>List of acceptable public key algorithms.private StringThe relying party identifier.private StringThe relying party name.Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcom.yubico.webauthn.CredentialRepositoryGet the credential repository used to store the valid webauthn credential.com.yubico.fido.metadata.FidoMetadataServiceGet the FIDO Alliance metadata service resolver to use as the attestation trust source.Class<?>Get the allowable origins for this Relying Party.List<com.yubico.webauthn.data.PublicKeyCredentialParameters>Get the ordered list of preferred public key credential parameters to send to the authenticator during registration.private StringGet the relying party identifier.private StringGet the relying party name.private booleanIs origin matching relaxed to allow any port number?private booleanIs origin matching relaxed to allow any subdomain?private booleanAllow untrusted attestations?booleanvoidsetAllowOriginPort(boolean allow) Allow unrestricted origin ports?voidsetAllowOriginSubdomain(boolean allow) Set if any subdomain is allowed.voidsetAllowUntrustedAttestation(boolean allow) Set if untrusted attestations (registrations) are allowed.voidsetCredentialRepository(com.yubico.webauthn.CredentialRepository repository) Set the credential repository used to store the valid webauthn credential.voidsetFidoMetadataService(com.yubico.fido.metadata.FidoMetadataService service) Set the FIDO Alliance metadata service resolver to use as the attestation trust source.voidsetOrigins(Set<String> allowedOrigins) Set the allowable origins for this Relying Party.voidsetPreferredPublickeyParams(List<String> publickeyParams) Set the ordered list of preferred public key credential parameters to send to the authenticator during registration.voidsetPreferredPublickeyParamsNative(List<com.yubico.webauthn.data.PublicKeyCredentialParameters> publickeyParams) Set the ordered list of preferred public key credential parameters to send to the authenticator during registration.voidsetRelyingPartyId(String relyingPartyIdentifier) Set the relying party identifier.voidsetRelyingPartyName(String name) Set the relying party name.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
relyingPartyId
The relying party identifier. -
relyingPartyName
The relying party name. -
allowOriginPort
private boolean allowOriginPortAllow unrestricted origin ports? Default is false. -
allowOriginSubdomain
private boolean allowOriginSubdomainAllow subdomains in origins? Default is false. -
credentialRepository
The credential repository to store valid credentials in. -
origins
Allowable origins the authenticator response can contain. Overrides an origin derived from the relyingPartyId if set. -
preferredPublickeyParams
@Nonnull @NonnullElements private List<com.yubico.webauthn.data.PublicKeyCredentialParameters> preferredPublickeyParamsList of acceptable public key algorithms. -
allowUntrustedAttestation
private boolean allowUntrustedAttestationShould we allow an untrusted attestation? -
fidoMetadataService
@Nullable private com.yubico.fido.metadata.FidoMetadataService fidoMetadataServiceIf configured, a FIDO metadata service resolver.
-
-
Constructor Details
-
YubicoWebauthnClientFactory
public YubicoWebauthnClientFactory()Constructor.
-
-
Method Details
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<WebAuthnAuthenticationClient>- Throws:
Exception
-
setPreferredPublickeyParamsNative
public void setPreferredPublickeyParamsNative(@Nonnull @NonnullElements List<com.yubico.webauthn.data.PublicKeyCredentialParameters> publickeyParams) Set the ordered list of preferred public key credential parameters to send to the authenticator during registration.- Parameters:
publickeyParams- the public key parameters to set.
-
setPreferredPublickeyParams
Set the ordered list of preferred public key credential parameters to send to the authenticator during registration.- Parameters:
publickeyParams- the COSE algorithm identifiers to set.
-
getPreferredPublickeyParams
@Nonnull @NonnullElements public List<com.yubico.webauthn.data.PublicKeyCredentialParameters> getPreferredPublickeyParams()Get the ordered list of preferred public key credential parameters to send to the authenticator during registration.- Returns:
- the public key parameters.
-
getCredentialRepository
@Nonnull public com.yubico.webauthn.CredentialRepository getCredentialRepository()Get the credential repository used to store the valid webauthn credential.- Returns:
- the credential repository.
-
getOrigins
Get the allowable origins for this Relying Party. Overrides the origin derived from the relyingPartyId if used- Returns:
- the origins.
-
setOrigins
Set the allowable origins for this Relying Party. Overrides the origin derived from the relyingPartyId if used- Parameters:
allowedOrigins- the origins to use
-
setCredentialRepository
public void setCredentialRepository(@Nonnull com.yubico.webauthn.CredentialRepository repository) Set the credential repository used to store the valid webauthn credential.- Parameters:
repository- The credential repository to set.
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<WebAuthnAuthenticationClient>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceFactoryBean<WebAuthnAuthenticationClient>
-
setRelyingPartyId
Set the relying party identifier.- Parameters:
relyingPartyIdentifier- the relying party identifier.
-
getRelyingPartyId
Get the relying party identifier.The RP ID must be equal to the origin's effective domain, or a registrable domain suffix of the origin's effective domain.
- Returns:
- the relying party identifier.
-
setRelyingPartyName
Set the relying party name.- Parameters:
name- the relying party name.
-
getRelyingPartyName
Get the relying party name.- Returns:
- the relying party name.
-
isAllowOriginPort
private boolean isAllowOriginPort()Is origin matching relaxed to allow any port number?- Returns:
- allow origin port?
-
setAllowOriginPort
public void setAllowOriginPort(boolean allow) Allow unrestricted origin ports?- Parameters:
allow- allow origin port.
-
isAllowOriginSubdomain
private boolean isAllowOriginSubdomain()Is origin matching relaxed to allow any subdomain?- Returns:
- allow subdomains?
-
setAllowOriginSubdomain
public void setAllowOriginSubdomain(boolean allow) Set if any subdomain is allowed.- Parameters:
allow- are subdomains allowed?
-
setAllowUntrustedAttestation
public void setAllowUntrustedAttestation(boolean allow) Set if untrusted attestations (registrations) are allowed.- Parameters:
allow- are untrusted attestations allowed?
-
isAllowUntrustedAttestation
private boolean isAllowUntrustedAttestation()Allow untrusted attestations?- Returns:
- if untrusted attestations are allowed.
-
setFidoMetadataService
public void setFidoMetadataService(@Nullable com.yubico.fido.metadata.FidoMetadataService service) Set the FIDO Alliance metadata service resolver to use as the attestation trust source.- Parameters:
service- The FIDO metadata service to set.
-
getFidoMetadataService
@Nullable public com.yubico.fido.metadata.FidoMetadataService getFidoMetadataService()Get the FIDO Alliance metadata service resolver to use as the attestation trust source.- Returns:
- the fido metadata service.
-