Interface WebAuthn
-
- All Superinterfaces:
AuthenticationProvider
public interface WebAuthn extends AuthenticationProvider
Factory interface for creating WebAuthN basedAuthenticationProvider
instances.- Author:
- Paulo Lopes
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description WebAuthn
authenticatorFetcher(java.util.function.Function<Authenticator,Future<List<Authenticator>>> fetcher)
Provide aFunction
that can fetchAuthenticator
s from a backend given the incompleteAuthenticator
argument.WebAuthn
authenticatorUpdater(java.util.function.Function<Authenticator,Future<Void>> updater)
Provide aFunction
that can update or insert aAuthenticator
.static WebAuthn
create(Vertx vertx)
Create a WebAuthN auth providerstatic WebAuthn
create(Vertx vertx, WebAuthnOptions options)
Create a WebAuthN auth providerFuture<JsonObject>
createCredentialsOptions(JsonObject user)
Gets a challenge and any other parameters for thenavigator.credentials.create()
call.Future<JsonObject>
getCredentialsOptions(String username)
Creates an assertion challenge and any other parameters for thenavigator.credentials.get()
call.MetaDataService
metaDataService()
Getter to the instance FIDO2 Meta Data Service.-
Methods inherited from interface io.vertx.ext.auth.authentication.AuthenticationProvider
authenticate
-
-
-
-
Method Detail
-
create
static WebAuthn create(Vertx vertx)
Create a WebAuthN auth provider- Parameters:
vertx
- the Vertx instance.- Returns:
- the auth provider.
-
create
static WebAuthn create(Vertx vertx, WebAuthnOptions options)
Create a WebAuthN auth provider- Parameters:
vertx
- the Vertx instance.options
- the custom options to the provider.- Returns:
- the auth provider.
-
createCredentialsOptions
Future<JsonObject> createCredentialsOptions(JsonObject user)
Gets a challenge and any other parameters for thenavigator.credentials.create()
call.The object being returned is described here https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptions
- Parameters:
user
- - the user object with name and optionally displayName and icon- Returns:
- a future notified with the encoded make credentials request
-
getCredentialsOptions
Future<JsonObject> getCredentialsOptions(String username)
Creates an assertion challenge and any other parameters for thenavigator.credentials.get()
call. If the auth provider is configured withRequireResidentKey
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-publickeycredentialcreationoptions
- Parameters:
username
- the unique user identified- Returns:
- a future notified with the server encoded get assertion request
-
authenticatorFetcher
WebAuthn authenticatorFetcher(java.util.function.Function<Authenticator,Future<List<Authenticator>>> fetcher)
Provide aFunction
that can fetchAuthenticator
s from a backend given the incompleteAuthenticator
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.Future
async result with a list of authenticators.
- Parameters:
fetcher
- fetcher function.- Returns:
- fluent self.
-
authenticatorUpdater
WebAuthn authenticatorUpdater(java.util.function.Function<Authenticator,Future<Void>> updater)
Provide aFunction
that can update or insert aAuthenticator
. 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.Future
async result of the operation.
- Parameters:
updater
- updater function.- Returns:
- fluent self.
-
metaDataService
MetaDataService metaDataService()
Getter to the instance FIDO2 Meta Data Service.- Returns:
- the MDS instance.
-
-