Class Extensions.CredentialProtection.CredentialProtectionInput
- Enclosing class:
- Extensions.CredentialProtection
credProtect
) extension.
Instances may be created using the prefer(CredentialProtectionPolicy)
and require(CredentialProtectionPolicy)
factory functions.
- Since:
- 2.7.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
The requested credential protection policy.int
hashCode()
boolean
If this istrue
andcredentialProtectionPolicy
is notExtensions.CredentialProtection.CredentialProtectionPolicy.UV_OPTIONAL
,RelyingParty.finishRegistration(FinishRegistrationOptions)
will validate that the policy set ingetCredentialProtectionPolicy()
was satisfied and the browser is requested to fail the registration if the policy cannot be satisfied.prefer
(@NonNull Extensions.CredentialProtection.CredentialProtectionPolicy policy) Create a Credential Protection (credProtect
) extension input that requests the given policy when possible.require
(@NonNull Extensions.CredentialProtection.CredentialProtectionPolicy policy) Create a Credential Protection (credProtect
) extension input that requires the given policy.toString()
-
Method Details
-
prefer
public static Extensions.CredentialProtection.CredentialProtectionInput prefer(@NonNull @NonNull Extensions.CredentialProtection.CredentialProtectionPolicy policy) Create a Credential Protection (credProtect
) extension input that requests the given policy when possible.If the policy cannot be satisfied, the browser is requested to continue the registration anyway. To determine what policy was applied, use
AuthenticatorRegistrationExtensionOutputs.getCredProtect()
to inspect the extension output.RelyingParty.finishRegistration(FinishRegistrationOptions)
will not validate what policy was applied.Use
require(CredentialProtectionPolicy)
instead to forbid the registration from proceeding if the extension is not supported or the policy cannot be satisfied.- Parameters:
policy
- the policy to request.- Returns:
- a
credProtect
extension input that requests the given policy when possible. The browser is requested to continue the registration even if this policy cannot be satisfied. - Since:
- 2.7.0
- See Also:
-
require
public static Extensions.CredentialProtection.CredentialProtectionInput require(@NonNull @NonNull Extensions.CredentialProtection.CredentialProtectionPolicy policy) Create a Credential Protection (credProtect
) extension input that requires the given policy.If the policy is not
Extensions.CredentialProtection.CredentialProtectionPolicy.UV_OPTIONAL
and cannot be satisfied, the browser is requested to abort the registration instead of proceeding.RelyingParty.finishRegistration(FinishRegistrationOptions)
will validate that the policy returned in the authenticator extension output equals this input policy, and throw an exception otherwise. You can also useAuthenticatorRegistrationExtensionOutputs.getCredProtect()
to inspect the extension output yourself.Note that if the browser or authenticator does not support the extension, the registration will fail. Use
prefer(CredentialProtectionPolicy)
instead to allow the registration to proceed if the extension is not supported or the policy cannot be satisfied.- Parameters:
policy
- the policy to require.- Returns:
- a
credProtect
extension input that requires the given policy. The browser is requested to abort the registration if this policy cannot be satisfied. - Since:
- 2.7.0
- See Also:
-
getCredentialProtectionPolicy
The requested credential protection policy. This policy may or may not be satisfied; seeisEnforceCredentialProtectionPolicy()
. -
isEnforceCredentialProtectionPolicy
public boolean isEnforceCredentialProtectionPolicy()If this istrue
andcredentialProtectionPolicy
is notExtensions.CredentialProtection.CredentialProtectionPolicy.UV_OPTIONAL
,RelyingParty.finishRegistration(FinishRegistrationOptions)
will validate that the policy set ingetCredentialProtectionPolicy()
was satisfied and the browser is requested to fail the registration if the policy cannot be satisfied.prefer(CredentialProtectionPolicy)
sets this tofalse
.require(CredentialProtectionPolicy)
sets this totrue
. -
equals
-
hashCode
public int hashCode() -
toString
-