Package net.shibboleth.idp.plugin.authn.webauthn.client.impl

# 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

Fields
Modifier and Type
Field
Description
`private boolean`
`allowOriginPort`
Allow unrestricted origin ports? Default is false.
`private boolean`
`allowOriginSubdomain`
Allow subdomains in origins? Default is false.
`private boolean`
`allowUntrustedAttestation`
Should we allow an untrusted attestation?
`private com.yubico.webauthn.CredentialRepository`
`credentialRepository`
The credential repository to store valid credentials in.
`private com.yubico.fido.metadata.FidoMetadataService`
`fidoMetadataService`
If configured, a FIDO metadata service resolver.
`private final org.slf4j.Logger`
`log`
Class logger.
`private Set<String>`
`origins`
Allowable origins the authenticator response can contain.
`private List<com.yubico.webauthn.data.PublicKeyCredentialParameters>`
`preferredPublickeyParams`
List of acceptable public key algorithms.
`private String`
`relyingPartyId`
The relying party identifier.
`private String`
`relyingPartyName`
The relying party name.

### Fields inherited from interface org.springframework.beans.factory.FactoryBean

`OBJECT_TYPE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`YubicoWebauthnClientFactory()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`com.yubico.webauthn.CredentialRepository`
`getCredentialRepository()`
Get the credential repository used to store the valid webauthn credential.
`com.yubico.fido.metadata.FidoMetadataService`
`getFidoMetadataService()`
Get the FIDO Alliance metadata service resolver to use as the attestation trust source.
`WebAuthnAuthenticationClient`
`getObject()`
`Class<?>`
`getObjectType()`
`Set<String>`
`getOrigins()`
Get the allowable origins for this Relying Party.
`List<com.yubico.webauthn.data.PublicKeyCredentialParameters>`
`getPreferredPublickeyParams()`
Get the ordered list of preferred public key credential parameters to send to the authenticator during registration.
`private String`
`getRelyingPartyId()`
Get the relying party identifier.
`private String`
`getRelyingPartyName()`
Get the relying party name.
`private boolean`
`isAllowOriginPort()`
Is origin matching relaxed to allow any port number?
`private boolean`
`isAllowOriginSubdomain()`
Is origin matching relaxed to allow any subdomain?
`private boolean`
`isAllowUntrustedAttestation()`
Allow untrusted attestations?
`boolean`
`isSingleton()`
`void`
`setAllowOriginPort(boolean allow)`
Allow unrestricted origin ports?
`void`
`setAllowOriginSubdomain(boolean allow)`
Set if any subdomain is allowed.
`void`
`setAllowUntrustedAttestation(boolean allow)`
Set if untrusted attestations (registrations) are allowed.
`void`
`setCredentialRepository(com.yubico.webauthn.CredentialRepository repository)`
Set the credential repository used to store the valid webauthn credential.
`void`
`setFidoMetadataService(com.yubico.fido.metadata.FidoMetadataService service)`
Set the FIDO Alliance metadata service resolver to use as the attestation trust source.
`void`
`setOrigins(Set<String> allowedOrigins)`
Set the allowable origins for this Relying Party.
`void`
`setPreferredPublickeyParams(List<String> publickeyParams)`
Set the ordered list of preferred public key credential parameters to send to the authenticator during registration.
`void`
`setPreferredPublickeyParamsNative(List<com.yubico.webauthn.data.PublicKeyCredentialParameters> publickeyParams)`
Set the ordered list of preferred public key credential parameters to send to the authenticator during registration.
`void`
`setRelyingPartyId(String relyingPartyIdentifier)`
Set the relying party identifier.
`void`
`setRelyingPartyName(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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### relyingPartyId

@NonnullAfterInit private String relyingPartyId
The relying party identifier.

### relyingPartyName

@NonnullAfterInit private String relyingPartyName
The relying party name.

### allowOriginPort

private boolean allowOriginPort
Allow unrestricted origin ports? Default is false.

### allowOriginSubdomain

private boolean allowOriginSubdomain
Allow subdomains in origins? Default is false.

### credentialRepository

@NonnullAfterInit private com.yubico.webauthn.CredentialRepository credentialRepository
The credential repository to store valid credentials in.

### origins

@Nonnull @NonnullElements private Set<String> 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> preferredPublickeyParams
List of acceptable public key algorithms.

### allowUntrustedAttestation

private boolean allowUntrustedAttestation
Should we allow an untrusted attestation?

### fidoMetadataService

@Nullable private com.yubico.fido.metadata.FidoMetadataService fidoMetadataService
If configured, a FIDO metadata service resolver.

## Constructor Details

### YubicoWebauthnClientFactory

public YubicoWebauthnClientFactory()
Constructor.

## Method Details

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### getObject

public WebAuthnAuthenticationClient getObject() throws Exception

Specified by:
  `getObject` in interface `FactoryBean<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

public void setPreferredPublickeyParams(@Nonnull @NonnullElements List<String> publickeyParams)
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

@Nonnull @NonnullElements @NotLive public Set<String> getOrigins()
Get the allowable origins for this Relying Party. Overrides the origin derived from the relyingPartyId if used

Returns:
  the origins.

### setOrigins

public void setOrigins(@Nullable Set<String> allowedOrigins)
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

public Class<?> getObjectType()

Specified by:
  `getObjectType` in interface `FactoryBean<WebAuthnAuthenticationClient>`

### isSingleton

public boolean isSingleton()

Specified by:
  `isSingleton` in interface `FactoryBean<WebAuthnAuthenticationClient>`

### setRelyingPartyId

public void setRelyingPartyId(@Nonnull String relyingPartyIdentifier)
Set the relying party identifier.

Parameters:
  `relyingPartyIdentifier` - the relying party identifier.

### getRelyingPartyId

@NonnullAfterInit private String 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

public void setRelyingPartyName(@Nonnull String name)
Set the relying party name.

Parameters:
  `name` - the relying party name.

### getRelyingPartyName

@NonnullAfterInit private String 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.