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 TypeMethodDescriptionvoidaccept(RoutingContext item) authenticate(Function<RoutingContext, io.smallrye.mutiny.Uni<User>> authenticationFunction) static SimpleAuthenticationHandlercreate()booleanio.vertx.ext.web.handler.SimpleAuthenticationHandlervoidhandle(RoutingContext arg0) inthashCode()static SimpleAuthenticationHandlernewInstance(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:
getDelegatein interfaceAuthenticationHandler- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handlein interfaceAuthenticationHandler- Specified by:
handlein 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:
acceptin interfaceAuthenticationHandler- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
newInstance
public static SimpleAuthenticationHandler newInstance(io.vertx.ext.web.handler.SimpleAuthenticationHandler arg)
-