Class WebAuthn4J

All Implemented Interfaces:
MutinyDelegate

public class WebAuthn4J extends AuthenticationProvider implements MutinyDelegate
Factory interface for creating WebAuthN based AuthenticationProvider instances.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Paulo Lopes
See Also:
  • WebAuthn4J
  • Field Details

  • Constructor Details

    • WebAuthn4J

      public WebAuthn4J(io.vertx.ext.auth.webauthn4j.WebAuthn4J delegate)
      Create a new instance of WebAuthn4J delegating to the given (non-null) instance of WebAuthn4J.
    • WebAuthn4J

      public WebAuthn4J(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.webauthn4j.WebAuthn4J getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Overrides:
      getDelegate in class AuthenticationProvider
      Returns:
      the delegate instance
    • createCredentialsOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> createCredentialsOptions(io.vertx.core.json.JsonObject user)
      Gets a challenge and any other parameters for the navigator.credentials.create() call.

      The object being returned is described here https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptions

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      user - - the user object with name and optionally displayName and icon
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • WebAuthn4J.createCredentialsOptions(JsonObject)
    • createCredentialsOptionsAndAwait

      public io.vertx.core.json.JsonObject createCredentialsOptionsAndAwait(io.vertx.core.json.JsonObject user)
      Gets a challenge and any other parameters for the navigator.credentials.create() call.

      The object being returned is described here https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptions

      Unlike the bare Vert.x variant, this method returns a JsonObject. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      user - - the user object with name and optionally displayName and icon
      Returns:
      The operation result
      See Also:
      • WebAuthn4J.createCredentialsOptions(JsonObject)
    • createCredentialsOptionsAndForget

      public WebAuthn4J createCredentialsOptionsAndForget(io.vertx.core.json.JsonObject user)
      Gets a challenge and any other parameters for the navigator.credentials.create() call.

      The object being returned is described here https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptions

      Unlike the bare Vert.x variant, this method ignores the JsonObject result or any failure.

      Parameters:
      user - - the user object with name and optionally displayName and icon
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • WebAuthn4J.createCredentialsOptions(JsonObject)
    • getCredentialsOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> getCredentialsOptions(String username)
      Creates an assertion challenge and any other parameters for the navigator.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-publickeycredentialcreationoptions

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      username - the unique user identified. Can be null.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • WebAuthn4J.getCredentialsOptions(String)
    • getCredentialsOptionsAndAwait

      public io.vertx.core.json.JsonObject getCredentialsOptionsAndAwait(String username)
      Creates an assertion challenge and any other parameters for the navigator.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-publickeycredentialcreationoptions

      Unlike the bare Vert.x variant, this method returns a JsonObject. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      username - the unique user identified
      Returns:
      The operation result
      See Also:
      • WebAuthn4J.getCredentialsOptions(String)
    • getCredentialsOptionsAndForget

      public WebAuthn4J getCredentialsOptionsAndForget(String username)
      Creates an assertion challenge and any other parameters for the navigator.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-publickeycredentialcreationoptions

      Unlike the bare Vert.x variant, this method ignores the JsonObject result or any failure.

      Parameters:
      username - the unique user identified
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • WebAuthn4J.getCredentialsOptions(String)
    • authenticate

      @CheckReturnValue public io.smallrye.mutiny.Uni<User> authenticate(io.vertx.ext.auth.authentication.Credentials credentials)
      Authenticate a user.

      The first argument is a Credentials object containing information for authenticating the user. What this actually contains depends on the specific implementation.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      authenticate in class AuthenticationProvider
      Parameters:
      credentials - The credentials
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • AuthenticationProvider.authenticate(Credentials)
    • authenticateAndAwait

      public User authenticateAndAwait(io.vertx.ext.auth.authentication.Credentials credentials)
      Authenticate a user.

      The first argument is a Credentials object containing information for authenticating the user. What this actually contains depends on the specific implementation.

      Unlike the bare Vert.x variant, this method returns a User. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      authenticateAndAwait in class AuthenticationProvider
      Parameters:
      credentials - The credentials
      Returns:
      The operation result
      See Also:
      • AuthenticationProvider.authenticate(Credentials)
    • authenticateAndForget

      public WebAuthn4J authenticateAndForget(io.vertx.ext.auth.authentication.Credentials credentials)
      Authenticate a user.

      The first argument is a Credentials object containing information for authenticating the user. What this actually contains depends on the specific implementation.

      Unlike the bare Vert.x variant, this method ignores the User result or any failure.

      Overrides:
      authenticateAndForget in class AuthenticationProvider
      Parameters:
      credentials - The credentials
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • AuthenticationProvider.authenticate(Credentials)
    • create

      public static WebAuthn4J create(Vertx vertx)
      Create a WebAuthN auth provider
      Parameters:
      vertx - the Vertx instance.
      Returns:
      the auth provider.
    • create

      public static WebAuthn4J create(Vertx vertx, io.vertx.ext.auth.webauthn4j.WebAuthn4JOptions options)
      Create a WebAuthN auth provider
      Parameters:
      vertx - the Vertx instance.
      options - the custom options to the provider.
      Returns:
      the auth provider.
    • credentialStorage

      public WebAuthn4J credentialStorage(CredentialStorage credentialStorage)
      Provide a CredentialStorage that can fetch Authenticators from storage and update them.
      Parameters:
      credentialStorage - the storage abstraction for credentials.
      Returns:
      fluent self.
    • newInstance

      public static WebAuthn4J newInstance(io.vertx.ext.auth.webauthn4j.WebAuthn4J delegate)
      Creates a new instance of the WebAuthn4J.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AuthenticationProvider
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AuthenticationProvider
    • toString

      public String toString()
      Overrides:
      toString in class AuthenticationProvider