Class JWTAuth
- All Implemented Interfaces:
MutinyDelegate
AuthenticationProvider instances.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Paulo Lopes
- See Also:
-
JWTAuth
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<User>authenticate(io.vertx.ext.auth.authentication.Credentials credentials) Authenticate a user.authenticateAndAwait(io.vertx.ext.auth.authentication.Credentials credentials) Authenticate a user.authenticateAndForget(io.vertx.ext.auth.authentication.Credentials credentials) Authenticate a user.static JWTAuthCreate a JWT auth providerbooleangenerateToken(io.vertx.core.json.JsonObject claims) Generate a new JWT token.generateToken(io.vertx.core.json.JsonObject claims, io.vertx.ext.auth.JWTOptions options) Generate a new JWT token.io.vertx.ext.auth.jwt.JWTAuthGet the delegate instance.inthashCode()static JWTAuthnewInstance(io.vertx.ext.auth.jwt.JWTAuth delegate) Creates a new instance of theJWTAuth.toString()Methods inherited from class io.vertx.mutiny.ext.auth.authentication.AuthenticationProvider
newInstance
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
JWTAuth
public JWTAuth(io.vertx.ext.auth.jwt.JWTAuth delegate) Create a new instance ofJWTAuthdelegating to the given (non-null) instance ofJWTAuth. -
JWTAuth
-
-
Method Details
-
getDelegate
public io.vertx.ext.auth.jwt.JWTAuth 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:
getDelegatein interfaceMutinyDelegate- Overrides:
getDelegatein classAuthenticationProvider- 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:
authenticatein classAuthenticationProvider- Parameters:
credentials- The credentials- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
AuthenticationProvider.authenticate(Credentials)
-
authenticateAndAwait
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 aRuntimeException).- Overrides:
authenticateAndAwaitin classAuthenticationProvider- Parameters:
credentials- The credentials- Returns:
- The operation result
- See Also:
-
AuthenticationProvider.authenticate(Credentials)
-
authenticateAndForget
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
Userresult or any failure.- Overrides:
authenticateAndForgetin classAuthenticationProvider- Parameters:
credentials- The credentials- Returns:
- The current instance to chain operations if needed.
- See Also:
-
AuthenticationProvider.authenticate(Credentials)
-
create
Create a JWT auth provider- Parameters:
vertx- the Vertx instanceconfig- the config- Returns:
- the auth provider
-
generateToken
public String generateToken(io.vertx.core.json.JsonObject claims, io.vertx.ext.auth.JWTOptions options) Generate a new JWT token.- Parameters:
claims- Json with user defined claims for a list of official claimsoptions- extra options for the generation- Returns:
- JWT encoded token
- See Also:
-
generateToken
Generate a new JWT token.- Parameters:
claims- Json with user defined claims for a list of official claims- Returns:
- JWT encoded token
- See Also:
-
newInstance
Creates a new instance of theJWTAuth. -
hashCode
public int hashCode()- Overrides:
hashCodein classAuthenticationProvider
-
equals
- Overrides:
equalsin classAuthenticationProvider
-
toString
- Overrides:
toStringin classAuthenticationProvider
-