Class AuthenticationProvider

    • Constructor Detail

      • AuthenticationProvider

        public AuthenticationProvider​(io.vertx.ext.auth.authentication.AuthenticationProvider delegate)
      • AuthenticationProvider

        public AuthenticationProvider​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.ext.auth.authentication.AuthenticationProvider getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • authenticate

        public io.smallrye.mutiny.Uni<User> authenticate​(io.vertx.core.json.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 object is passed to the handler in an . The user object can then be used for authorisation.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        credentials - The credentials
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • authenticateAndAwait

        public User authenticateAndAwait​(io.vertx.core.json.JsonObject credentials)
        Blocking variant of authenticate(JsonObject).

        This method waits 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:
        credentials - The credentials
        Returns:
        the User instance produced by the operation.
      • authenticateAndForget

        public void authenticateAndForget​(io.vertx.core.json.JsonObject credentials)
        Variant of authenticate(JsonObject) that ignores the result of the operation.

        This method subscribes on the result of authenticate(JsonObject), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from authenticate(JsonObject) but you don't need to compose it with other operations.

        Parameters:
        credentials - The credentials
      • authenticate

        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. If the user is successfully authenticated a object is passed to the handler in an . The user object can then be used for authorisation.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        credentials - The credentials
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • authenticateAndAwait

        public User authenticateAndAwait​(io.vertx.ext.auth.authentication.Credentials credentials)
        Blocking variant of authenticate(Credentials).

        This method waits 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:
        credentials - The credentials
        Returns:
        the User instance produced by the operation.
      • authenticateAndForget

        public void authenticateAndForget​(io.vertx.ext.auth.authentication.Credentials credentials)
        Variant of authenticate(Credentials) that ignores the result of the operation.

        This method subscribes on the result of authenticate(Credentials), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from authenticate(Credentials) but you don't need to compose it with other operations.

        Parameters:
        credentials - The credentials
      • newInstance

        public static AuthenticationProvider newInstance​(io.vertx.ext.auth.authentication.AuthenticationProvider arg)