Class AssertionRequest
PublicKeyCredentialRequestOptions
and, optionally, a username
.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
static AssertionRequest
Decode anAssertionRequest
from JSON.@NonNull PublicKeyCredentialRequestOptions
An object that can be serialized to JSON and passed as thepublicKey
argument tonavigator.credentials.get()
.The username of the user to authenticate, if the user has already been identified.int
hashCode()
Serialize thisAssertionRequest
value to JSON suitable for sending to the client.toJson()
Encode thisAssertionRequest
to JSON.toString()
-
Method Details
-
getUsername
The username of the user to authenticate, if the user has already been identified.If this is absent, this indicates that this is a request for an assertion by a client-side-resident credential, and identification of the user has been deferred until the response is received.
-
toCredentialsGetJson
Serialize thisAssertionRequest
value to JSON suitable for sending to the client.This is an alias of
getPublicKeyCredentialRequestOptions().toCredentialsGetJson()
.Any
ByteArray
values in this data structure will beBase64Url
encoded. Those values MUST be decoded intoBufferSource
values (such asUint8Array
) on the client side before callingnavigator.credentials.get()
.After decoding binary values, the resulting JavaScript object is suitable for passing as an argument to
navigator.credentials.get()
.- Returns:
- a JSON value suitable for sending to the client and passing as an argument to
navigator.credentials.get()
, after decoding binary options from Base64Url strings. - Throws:
com.fasterxml.jackson.core.JsonProcessingException
- if JSON serialization fails.
-
toJson
Encode thisAssertionRequest
to JSON. The inverse offromJson(String)
.This method is suitable for encoding the
AssertionRequest
for temporary storage so that it can later be passed as an argument toRelyingParty.finishAssertion(FinishAssertionOptions)
. ThefromJson(String)
factory function is guaranteed to restore an identicalAssertionRequest
instance.Note that encoding might not be needed if you can simply keep the
AssertionRequest
instance in server memory.- Returns:
- this
AssertionRequest
encoded to JSON. - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
fromJson
public static AssertionRequest fromJson(String json) throws com.fasterxml.jackson.core.JsonProcessingException Decode anAssertionRequest
from JSON. The inverse oftoJson()
.If the JSON was generated by the
toJson()
method, thenfromJson(String)
in the same library version guarantees to restore an identicalAssertionRequest
instance. This is not guaranteed between different library versions.- Returns:
- a
AssertionRequest
decoded from the input JSON. - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
builder
-
toBuilder
-
getPublicKeyCredentialRequestOptions
An object that can be serialized to JSON and passed as thepublicKey
argument tonavigator.credentials.get()
. -
equals
-
hashCode
public int hashCode() -
toString
-