public static class RelyingParty.RelyingPartyBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RelyingParty.RelyingPartyBuilder.MandatoryStages |
Modifier and Type | Method and Description |
---|---|
RelyingParty.RelyingPartyBuilder |
allowUnrequestedExtensions(boolean allowUnrequestedExtensions)
If
true , finishRegistration and finishAssertion will accept responses containing extension outputs for
which there was no extension input. |
RelyingParty.RelyingPartyBuilder |
allowUntrustedAttestation(boolean allowUntrustedAttestation)
If
true , finishRegistration will only allow
registrations where the attestation signature can be linked to a trusted attestation root. |
RelyingParty.RelyingPartyBuilder |
appId(@NonNull AppId appId)
The extension input to set for the
appid extension when initiating authentication operations. |
RelyingParty.RelyingPartyBuilder |
appId(@NonNull java.util.Optional<AppId> appId)
The extension input to set for the
appid extension when initiating authentication operations. |
RelyingParty.RelyingPartyBuilder |
attestationConveyancePreference(@NonNull AttestationConveyancePreference attestationConveyancePreference)
The argument for the
attestation parameter in
registration operations. |
RelyingParty.RelyingPartyBuilder |
attestationConveyancePreference(@NonNull java.util.Optional<AttestationConveyancePreference> attestationConveyancePreference)
The argument for the
attestation parameter in
registration operations. |
RelyingParty |
build() |
RelyingParty.RelyingPartyBuilder |
credentialRepository(@NonNull CredentialRepository credentialRepository)
An abstract database which can look up credentials, usernames and user handles from usernames, user handles and
credential IDs.
|
RelyingParty.RelyingPartyBuilder |
identity(@NonNull RelyingPartyIdentity identity)
The
RelyingPartyIdentity that will be set as the rp
parameter when initiating registration operations, and which AuthenticatorData.getRpIdHash() will be
compared against. |
RelyingParty.RelyingPartyBuilder |
metadataService(@NonNull MetadataService metadataService)
A
MetadataService instance to use for looking up device attestation metadata. |
RelyingParty.RelyingPartyBuilder |
metadataService(@NonNull java.util.Optional<MetadataService> metadataService)
A
MetadataService instance to use for looking up device attestation metadata. |
RelyingParty.RelyingPartyBuilder |
origins(@NonNull java.util.Set<java.lang.String> origins)
The allowed origins that returned authenticator responses will be compared against.
|
RelyingParty.RelyingPartyBuilder |
preferredPubkeyParams(@NonNull java.util.List<PublicKeyCredentialParameters> preferredPubkeyParams)
The argument for the
pubKeyCredParams parameter
in registration operations. |
java.lang.String |
toString() |
RelyingParty.RelyingPartyBuilder |
validateSignatureCounter(boolean validateSignatureCounter)
If
true , finishAssertion will fail if the signature counter value in the response is not strictly greater than the
stored signature counter value . |
public RelyingParty.RelyingPartyBuilder appId(@NonNull @NonNull java.util.Optional<AppId> appId)
appid
extension when initiating authentication operations.
If this member is set, startAssertion
will automatically set the
appid
extension input, and finishAssertion
will
adjust its verification logic to also accept this AppID as an alternative to the RP ID.
By default, this is not set.
public RelyingParty.RelyingPartyBuilder appId(@NonNull @NonNull AppId appId)
appid
extension when initiating authentication operations.
If this member is set, startAssertion
will automatically set the
appid
extension input, and finishAssertion
will
adjust its verification logic to also accept this AppID as an alternative to the RP ID.
By default, this is not set.
public RelyingParty.RelyingPartyBuilder attestationConveyancePreference(@NonNull @NonNull java.util.Optional<AttestationConveyancePreference> attestationConveyancePreference)
attestation
parameter in
registration operations.
Unless your application has a concrete policy for authenticator attestation, it is recommended to leave this parameter undefined.
By default, this is not set.
public RelyingParty.RelyingPartyBuilder attestationConveyancePreference(@NonNull @NonNull AttestationConveyancePreference attestationConveyancePreference)
attestation
parameter in
registration operations.
Unless your application has a concrete policy for authenticator attestation, it is recommended to leave this parameter undefined.
By default, this is not set.
public RelyingParty.RelyingPartyBuilder metadataService(@NonNull @NonNull java.util.Optional<MetadataService> metadataService)
MetadataService
instance to use for looking up device attestation metadata. This matters only if RelyingParty.getAttestationConveyancePreference()
is non-empty and not set to AttestationConveyancePreference.NONE
.
By default, this is not set.
public RelyingParty.RelyingPartyBuilder metadataService(@NonNull @NonNull MetadataService metadataService)
MetadataService
instance to use for looking up device attestation metadata. This matters only if RelyingParty.getAttestationConveyancePreference()
is non-empty and not set to AttestationConveyancePreference.NONE
.
By default, this is not set.
public RelyingParty.RelyingPartyBuilder identity(@NonNull @NonNull RelyingPartyIdentity identity)
RelyingPartyIdentity
that will be set as the rp
parameter when initiating registration operations, and which AuthenticatorData.getRpIdHash()
will be
compared against. This is a required parameter.
A successful registration or authentication operation requires AuthenticatorData.getRpIdHash()
to exactly
equal the SHA-256 hash of this member's id
member. Alternatively, it may
instead equal the SHA-256 hash of appId
if the latter is present.
public RelyingParty.RelyingPartyBuilder origins(@NonNull @NonNull java.util.Set<java.lang.String> origins)
The default is the set containing only the string "https://" +
.
RelyingParty.getIdentity()
.getId()
A successful registration or authentication operation requires CollectedClientData.getOrigin()
to exactly
equal one of these values.
RelyingParty.getIdentity()
public RelyingParty.RelyingPartyBuilder credentialRepository(@NonNull @NonNull CredentialRepository credentialRepository)
This is used to look up:
PublicKeyCredentialCreationOptions.getExcludeCredentials()
PublicKeyCredentialRequestOptions.getAllowCredentials()
public RelyingParty.RelyingPartyBuilder preferredPubkeyParams(@NonNull @NonNull java.util.List<PublicKeyCredentialParameters> preferredPubkeyParams)
pubKeyCredParams
parameter
in registration operations.
This is a list of acceptable public key algorithms and their parameters, ordered from most to least preferred.
The default is the following list:
public RelyingParty.RelyingPartyBuilder allowUnrequestedExtensions(boolean allowUnrequestedExtensions)
true
, finishRegistration
and finishAssertion
will accept responses containing extension outputs for
which there was no extension input.
The default is false
.
public RelyingParty.RelyingPartyBuilder allowUntrustedAttestation(boolean allowUntrustedAttestation)
true
, finishRegistration
will only allow
registrations where the attestation signature can be linked to a trusted attestation root. This excludes self
attestation and none attestation.
Regardless of the value of this option, invalid attestation statements of supported formats will always be
rejected. For example, a "packed" attestation statement with an invalid signature will be rejected even if this
option is set to true
.
The default is true
.
public RelyingParty.RelyingPartyBuilder validateSignatureCounter(boolean validateSignatureCounter)
true
, finishAssertion
will fail if the signature counter value
in the response is not strictly greater than the
stored signature counter value
.
The default is true
.
public RelyingParty build()
public java.lang.String toString()
toString
in class java.lang.Object