Package io.vertx.mutiny.ext.web.handler
Class SimpleAuthenticationHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.SimpleAuthenticationHandler
- All Implemented Interfaces:
MutinyDelegate
,io.vertx.core.Handler<RoutingContext>
,AuthenticationHandler
,Consumer<RoutingContext>
public class SimpleAuthenticationHandler
extends Object
implements MutinyDelegate, AuthenticationHandler, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
A user customizable authentication handler.
An auth handler allows your application to provide authentication support. The handler is not fully functional
without a authentication function. This function takes the as input and returns a .
The future should return a non null
user object. In the authenticate(java.util.function.Function<io.vertx.mutiny.ext.web.RoutingContext, io.smallrye.mutiny.Uni<io.vertx.mutiny.ext.auth.User>>)
you have full control
on the request, so all operations like redirect, next, fail are allowed. There are some rules that need to be followed
in order to allow this handler to properly interop with ChainAuthHandler
.
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleAuthenticationHandler
(io.vertx.ext.web.handler.SimpleAuthenticationHandler delegate) SimpleAuthenticationHandler
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(RoutingContext item) authenticate
(Function<RoutingContext, io.smallrye.mutiny.Uni<User>> authenticationFunction) static SimpleAuthenticationHandler
create()
boolean
io.vertx.ext.web.handler.SimpleAuthenticationHandler
void
handle
(RoutingContext arg0) int
hashCode()
static SimpleAuthenticationHandler
newInstance
(io.vertx.ext.web.handler.SimpleAuthenticationHandler arg) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
SimpleAuthenticationHandler
public SimpleAuthenticationHandler(io.vertx.ext.web.handler.SimpleAuthenticationHandler delegate) -
SimpleAuthenticationHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.handler.SimpleAuthenticationHandler getDelegate()- Specified by:
getDelegate
in interfaceAuthenticationHandler
- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handle
in interfaceAuthenticationHandler
- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
-
create
- Returns:
- a new instance.
-
authenticate
public SimpleAuthenticationHandler authenticate(Function<RoutingContext, io.smallrye.mutiny.Uni<User>> authenticationFunction) - Parameters:
authenticationFunction
- the authentication function.- Returns:
- self
-
accept
- Specified by:
accept
in interfaceAuthenticationHandler
- Specified by:
accept
in interfaceConsumer<RoutingContext>
-
newInstance
public static SimpleAuthenticationHandler newInstance(io.vertx.ext.web.handler.SimpleAuthenticationHandler arg)
-