public final class AssertionRequest
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AssertionRequest.AssertionRequestBuilder |
| Modifier and Type | Method and Description |
|---|---|
static AssertionRequest.AssertionRequestBuilder.MandatoryStages |
builder() |
boolean |
equals(java.lang.Object o) |
static AssertionRequest |
fromJson(java.lang.String json)
Decode an
AssertionRequest from JSON. |
@NonNull PublicKeyCredentialRequestOptions |
getPublicKeyCredentialRequestOptions()
An object that can be serialized to JSON and passed as the
publicKey argument to
navigator.credentials.get(). |
java.util.Optional<ByteArray> |
getUserHandle()
The user handle of the user to authenticate, if the user has already been identified.
|
java.util.Optional<java.lang.String> |
getUsername()
The username of the user to authenticate, if the user has already been identified.
|
int |
hashCode() |
AssertionRequest.AssertionRequestBuilder |
toBuilder() |
java.lang.String |
toCredentialsGetJson()
Serialize this
AssertionRequest value to JSON suitable for sending to the client. |
java.lang.String |
toJson()
Encode this
AssertionRequest to JSON. |
java.lang.String |
toString() |
public java.util.Optional<java.lang.String> getUsername()
This is mutually exclusive with getUserHandle(); if this is present, then getUserHandle() will be empty.
If both this and getUserHandle() are empty, this indicates that this is a request
for an assertion by a client-side-discoverable
credential, and identification of the user has been deferred until the response is
received.
public java.util.Optional<ByteArray> getUserHandle()
This is mutually exclusive with getUsername(); if this is present, then getUsername() will be empty.
If both this and getUsername() are empty, this indicates that this is a request for
an assertion by a client-side-discoverable
credential, and identification of the user has been deferred until the response is
received.
public java.lang.String toCredentialsGetJson()
throws com.fasterxml.jackson.core.JsonProcessingException
AssertionRequest value to JSON suitable for sending to the client.
This is an alias of getPublicKeyCredentialRequestOptions().toCredentialsGetJson()
.
Any ByteArray values in this data structure will be Base64Url encoded. Those values MUST be decoded into BufferSource values (such as
Uint8Array) on the client side before calling navigator.credentials.get()
.
After decoding binary values, the resulting JavaScript object is suitable for passing as an
argument to navigator.credentials.get().
navigator.credentials.get(), after decoding binary options from Base64Url strings.com.fasterxml.jackson.core.JsonProcessingException - if JSON serialization fails.public java.lang.String toJson()
throws com.fasterxml.jackson.core.JsonProcessingException
AssertionRequest to JSON. The inverse of fromJson(String).
This method is suitable for encoding the AssertionRequest for temporary storage so
that it can later be passed as an argument to RelyingParty.finishAssertion(FinishAssertionOptions). The fromJson(String) factory
function is guaranteed to restore an identical AssertionRequest instance.
Note that encoding might not be needed if you can simply keep the AssertionRequest
instance in server memory.
AssertionRequest encoded to JSON.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static AssertionRequest fromJson(java.lang.String json) throws com.fasterxml.jackson.core.JsonProcessingException
AssertionRequest from JSON. The inverse of toJson().
If the JSON was generated by the toJson() method, then fromJson(String) in
the same library version guarantees to restore an identical AssertionRequest instance.
This is not guaranteed between different library versions.
AssertionRequest decoded from the input JSON.com.fasterxml.jackson.core.JsonProcessingExceptionpublic static AssertionRequest.AssertionRequestBuilder.MandatoryStages builder()
public AssertionRequest.AssertionRequestBuilder toBuilder()
@NonNull public @NonNull PublicKeyCredentialRequestOptions getPublicKeyCredentialRequestOptions()
publicKey argument to
navigator.credentials.get().public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object