io.vertx.ext.auth.authentication

## Interface AuthenticationProvider

- All Known Subinterfaces:
    AuthProvider, ChainAuth, HotpAuth, HtdigestAuth, HtpasswdAuth, JDBCAuth, JDBCAuthentication, JWTAuth, LdapAuthentication, MongoAuth, MongoAuthentication, OAuth2Auth, PropertyFileAuthentication, ShiroAuth, SqlAuthentication, TotpAuth, WebAuthn

      public interface AuthenticationProvider

  User-facing interface for authenticating users.
  Author:
    Tim Fox

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default Future<User>` | `authenticate(Credentials credentials)` Authenticate a user.
    `default void` | `authenticate(Credentials credentials, Handler<AsyncResult<User>> resultHandler)` Authenticate a user.
    `default Future<User>` | `authenticate(JsonObject credentials)` Authenticate a user.
    `void` | `authenticate(JsonObject credentials, Handler<AsyncResult<User>> resultHandler)` Authenticate a user.

- - ### Method Detail

    - #### authenticate

          void authenticate(JsonObject credentials,
                            Handler<AsyncResult<User>> resultHandler)

      Authenticate a user.

      The 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.

      Parameters:
        `credentials` - The credentials
        `resultHandler` - The result handler

    - #### authenticate

          default Future<User> authenticate(JsonObject credentials)

      Authenticate a user.

      The 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.

      Parameters:
        `credentials` - The credentials
      Returns:
        The result future
      See Also:
        `authenticate(JsonObject, Handler)`

    - #### authenticate

          default void authenticate(Credentials credentials,
                                    Handler<AsyncResult<User>> resultHandler)

      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. 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.

      Parameters:
        `credentials` - The credentials
        `resultHandler` - The result handler

    - #### authenticate

          default Future<User> authenticate(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.

      Parameters:
        `credentials` - The credentials
      Returns:
        The result future
      See Also:
        `authenticate(Credentials, Handler)`

Copyright © 2022 Eclipse. All rights reserved.