Class HotpAuth

All Implemented Interfaces:
MutinyDelegate

public class HotpAuth extends AuthenticationProvider implements MutinyDelegate
An extension of AuthProvider which uses the one time passwords based on counter to perform authentication.

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

Author:
Dmitry Novikov
See Also:
  • HotpAuth
  • Field Details

  • Constructor Details

    • HotpAuth

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

      public HotpAuth(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.otp.hotp.HotpAuth 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
    • createAuthenticator

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.auth.otp.Authenticator> createAuthenticator(String id, io.vertx.ext.auth.otp.OtpKey otpKey)
      Creating authenticator from user id and key.

      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:
      id - id user.
      otpKey - key of user used for auth.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HotpAuth.createAuthenticator(String, OtpKey)
    • createAuthenticatorAndAwait

      public io.vertx.ext.auth.otp.Authenticator createAuthenticatorAndAwait(String id, io.vertx.ext.auth.otp.OtpKey otpKey)
      Creating authenticator from user id and key.

      Unlike the bare Vert.x variant, this method returns a Authenticator. 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:
      id - id user.
      otpKey - key of user used for auth.
      Returns:
      The operation result
      See Also:
      • HotpAuth.createAuthenticator(String, OtpKey)
    • createAuthenticatorAndForget

      public HotpAuth createAuthenticatorAndForget(String id, io.vertx.ext.auth.otp.OtpKey otpKey)
      Creating authenticator from user id and key.

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

      Parameters:
      id - id user.
      otpKey - key of user used for auth.
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HotpAuth.createAuthenticator(String, OtpKey)
    • 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 HotpAuth 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)
    • authenticatorFetcher

      public HotpAuth authenticatorFetcher(Function<String,io.smallrye.mutiny.Uni<io.vertx.ext.auth.otp.Authenticator>> fetcher)
      Provide a Function that can fetch Authenticators from a backend given an identifier argument.

      The function signature is as follows:

      (id) -> Future<Authenticator>

      • id the identifier to lookup.
      • Future async result with a authenticator.
      Parameters:
      fetcher - fetcher function.
      Returns:
      fluent self.
    • authenticatorUpdater

      public HotpAuth authenticatorUpdater(Function<io.vertx.ext.auth.otp.Authenticator,io.smallrye.mutiny.Uni<Void>> updater)
      Provide a Function 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.
      Parameters:
      updater - updater function.
      Returns:
      fluent self.
    • generateUri

      public String generateUri(io.vertx.ext.auth.otp.OtpKey otpKey, String issuer, String user, String label)
      Creating URI for register in key in user device.
      Parameters:
      otpKey - user key.
      issuer - issuer of key.
      user - display name of user account.
      label - the label to identify which account a key is associated with.
      Returns:
      uri containing the key.
    • generateUri

      public String generateUri(io.vertx.ext.auth.otp.OtpKey otpKey, String issuer, String user)
      Creating URI for register in key in user device.
      Parameters:
      otpKey - user key.
      issuer - issuer of key.
      user - display name of user account.
      Returns:
      uri containing the key.
    • generateUri

      public String generateUri(io.vertx.ext.auth.otp.OtpKey otpKey, String label)
      Creating URI for register in key in user device.
      Parameters:
      otpKey - user key.
      label - the label to identify which account a key is associated with.
      Returns:
      uri containing the key.
    • create

      public static HotpAuth create()
      Creates an instance of HotpAuth.
      Returns:
      the created instance of HotpAuth.
    • create

      public static HotpAuth create(io.vertx.ext.auth.otp.hotp.HotpAuthOptions hotpAuthOptions)
      Creates an instance of HotpAuth.
      Parameters:
      hotpAuthOptions - the config.
      Returns:
      the created instance of HotpAuth.
    • newInstance

      public static HotpAuth newInstance(io.vertx.ext.auth.otp.hotp.HotpAuth delegate)
      Creates a new instance of the HotpAuth.
    • 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