Interface Authenticator
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
public interface Authenticator extends java.io.CloseableAuthentication mechanism.- Author:
- Sebastian Ćaskawiec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<RestResponse>challenge(RestRequest request, io.netty.channel.ChannelHandlerContext ctx)Challenges specificRestRequestfor authentication.default voidclose()default voidinit(RestServer restServer)Invoked by theRestServeron startup.default booleanisReadyForHttpChallenge()Returns whether the realm backing this authenticator is ready to authenticate users
-
-
-
Method Detail
-
challenge
java.util.concurrent.CompletionStage<RestResponse> challenge(RestRequest request, io.netty.channel.ChannelHandlerContext ctx)
Challenges specificRestRequestfor authentication.- Parameters:
request- Request to be challenged.- Returns:
- a
RestResponsewrapped in aCompletionStage
-
init
default void init(RestServer restServer)
Invoked by theRestServeron startup. Can perform additional configuration- Parameters:
restServer-
-
isReadyForHttpChallenge
default boolean isReadyForHttpChallenge()
Returns whether the realm backing this authenticator is ready to authenticate users- Returns:
- a boolean indicating whether the real is empty (i.e. has no users)
-
close
default void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-