Class MongoAuthentication

java.lang.Object
io.vertx.mutiny.ext.auth.authentication.AuthenticationProvider
io.vertx.mutiny.ext.auth.mongo.MongoAuthentication
All Implemented Interfaces:
MutinyDelegate

public class MongoAuthentication extends AuthenticationProvider implements MutinyDelegate
An extension of AuthProvider which is using MongoClient as store

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

Author:
francoisprunier
See Also:
  • MongoAuthentication
  • Field Details

  • Constructor Details

    • MongoAuthentication

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

      public MongoAuthentication(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.mongo.MongoAuthentication 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
    • 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 MongoAuthentication 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 MongoAuthentication create(MongoClient mongoClient, io.vertx.ext.auth.mongo.MongoAuthenticationOptions options)
      Creates an instance of MongoAuth by using the given MongoClient and configuration object.
      Parameters:
      mongoClient - an instance of MongoClient to be used for data storage and retrival
      options - the configuration object for the current instance.
      Returns:
      the created instance of MongoAuthentication
    • hash

      public String hash(String id, Map<String,String> params, String salt, String password)
      Hashes a password to be stored. See: HashingStrategy.hash(String, Map, String, String)
    • hash

      public String hash(String id, String salt, String password)
      Hashes a password to be stored. See: HashingStrategy.hash(String, Map, String, String)
    • newInstance

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