public class WebAuthnImpl extends Object implements WebAuthn
| Constructor and Description |
|---|
WebAuthnImpl(Vertx vertx,
WebAuthnOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(Credentials credentials,
Handler<AsyncResult<User>> handler)
Authenticate a user.
|
void |
authenticate(JsonObject authInfo,
Handler<AsyncResult<User>> handler)
Authenticate a user.
|
WebAuthn |
authenticatorFetcher(Function<Authenticator,Future<List<Authenticator>>> fetcher)
Provide a
Function that can fetch Authenticators from a backend given the incomplete
Authenticator argument. |
WebAuthn |
authenticatorUpdater(Function<Authenticator,Future<Void>> updater)
Provide a
Function that can update or insert a Authenticator. |
WebAuthn |
createCredentialsOptions(JsonObject user,
Handler<AsyncResult<JsonObject>> handler)
Gets a challenge and any other parameters for the
navigator.credentials.create() call. |
WebAuthn |
getCredentialsOptions(String name,
Handler<AsyncResult<JsonObject>> handler)
Creates an assertion challenge and any other parameters for the
navigator.credentials.get() call. |
MetaDataService |
metaDataService()
Internal API not fully ready for prime time
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createCredentialsOptions, getCredentialsOptionsauthenticate, authenticatepublic WebAuthnImpl(Vertx vertx, WebAuthnOptions options)
public WebAuthn authenticatorFetcher(Function<Authenticator,Future<List<Authenticator>>> fetcher)
WebAuthnFunction that can fetch Authenticators from a backend given the incomplete
Authenticator argument.
The implementation must consider the following fields exclusively, while performing the lookup:
It may return more than 1 result, for example when a user can be identified using different modalities.
To signal that a user is not allowed/present on the system, a failure should be returned, not null.
The function signature is as follows:
(Authenticator) -> Future<List<Authenticator>>>
Authenticator the incomplete authenticator data to lookup.Futureasync result with a list of authenticators.authenticatorFetcher in interface WebAuthnfetcher - fetcher function.public WebAuthn authenticatorUpdater(Function<Authenticator,Future<Void>> updater)
WebAuthnFunction that can update or insert a Authenticator.
The function should store a given authenticator to a persistence storage.
When an authenticator is already present, this method must at least update
Authenticator.getCounter(), and is not required to perform any other update.
For new authenticators, the whole object data must be persisted.
The function signature is as follows:
(Authenticator) -> Future<Void>
Authenticator the authenticator data to update.Futureasync result of the operation.authenticatorUpdater in interface WebAuthnupdater - updater function.public WebAuthn createCredentialsOptions(JsonObject user, Handler<AsyncResult<JsonObject>> handler)
WebAuthnnavigator.credentials.create() call.
The object being returned is described here https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionscreateCredentialsOptions in interface WebAuthnuser - - the user object with name and optionally displayName and iconhandler - server encoded make credentials requestpublic WebAuthn getCredentialsOptions(String name, Handler<AsyncResult<JsonObject>> handler)
WebAuthnnavigator.credentials.get() call.
If the auth provider is configured with RequireResidentKey and the username is null then the
generated assertion will be a RK assertion (Usernameless).
The object being returned is described here https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionsgetCredentialsOptions in interface WebAuthnname - the unique user identifiedhandler - server encoded get assertion requestpublic void authenticate(JsonObject authInfo, Handler<AsyncResult<User>> handler)
AuthenticationProviderThe first argument is a JSON object containing information for authenticating the user. What this actually contains depends on the specific implementation. In the case of a simple username/password based authentication it is likely to contain a JSON object with the following structure:
{
"username": "tim",
"password": "mypassword"
}
For other types of authentication it contain different information - for example a JWT token or OAuth bearer token.
If the user is successfully authenticated a User object is passed to the handler in an AsyncResult.
The user object can then be used for authorisation.
authenticate in interface AuthenticationProviderauthInfo - The credentialshandler - The result handlerpublic void authenticate(Credentials credentials, Handler<AsyncResult<User>> handler)
AuthenticationProvider
The first argument is a Credentials object containing information for authenticating the user.
What this actually contains depends on the specific implementation.
If the user is successfully authenticated a User object is passed to the handler in an AsyncResult.
The user object can then be used for authorisation.
authenticate in interface AuthenticationProvidercredentials - The credentialshandler - The result handlerpublic MetaDataService metaDataService()
metaDataService in interface WebAuthnCopyright © 2021. All rights reserved.