Package com.gmt2001.httpwsserver.auth
Class HttpNoAuthenticationHandler
java.lang.Object
com.gmt2001.httpwsserver.auth.HttpNoAuthenticationHandler
- All Implemented Interfaces:
HttpAuthenticationHandler
Provides a
HttpAuthenticationHandler
that allows all requests- Author:
- gmt2001
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Always returnstrue
, since this handler is for No Authenticationstatic HttpNoAuthenticationHandler
instance()
Gets a handler instancevoid
Invalidates the authentication of the specifiedChannelHandlerContext
, if supported by the authentication handlerboolean
isAuthorized
(ChannelHandlerContext ctx, FullHttpRequest req) Checks if the givenFullHttpRequest
is a valid authentication request, or if the underlyingChannel
has already been authenticated When returningfalse
, this method MUST NOT send a response to the clientboolean
isAuthorized
(ChannelHandlerContext ctx, HttpHeaders headers) Checks if the givenHttpHeaders
contain a valid authorization, or if the underlyingChannel
has already been authenticated When returningfalse
, this method MUST NOT send a response to the clientboolean
isAuthorized
(String user, String pass) Checks if the given username and password is a valid When returningfalse
, this method MUST NOT send a response to the client
-
Constructor Details
-
HttpNoAuthenticationHandler
public HttpNoAuthenticationHandler()
-
-
Method Details
-
instance
Gets a handler instance- Returns:
- An instance of
HttpNoAuthenticationHandler
-
checkAuthorization
Always returnstrue
, since this handler is for No Authentication- Specified by:
checkAuthorization
in interfaceHttpAuthenticationHandler
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionreq
- TheFullHttpRequest
of the request- Returns:
-
invalidateAuthorization
Description copied from interface:HttpAuthenticationHandler
Invalidates the authentication of the specifiedChannelHandlerContext
, if supported by the authentication handler- Specified by:
invalidateAuthorization
in interfaceHttpAuthenticationHandler
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionreq
- TheFullHttpRequest
-
isAuthorized
Description copied from interface:HttpAuthenticationHandler
Checks if the givenFullHttpRequest
is a valid authentication request, or if the underlyingChannel
has already been authenticated When returningfalse
, this method MUST NOT send a response to the client- Specified by:
isAuthorized
in interfaceHttpAuthenticationHandler
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionreq
- TheFullHttpRequest
to check- Returns:
- otherwise
-
isAuthorized
Description copied from interface:HttpAuthenticationHandler
Checks if the given username and password is a valid When returningfalse
, this method MUST NOT send a response to the client- Specified by:
isAuthorized
in interfaceHttpAuthenticationHandler
- Parameters:
user
- The usernamepass
- The password- Returns:
- otherwise
-
isAuthorized
Description copied from interface:HttpAuthenticationHandler
Checks if the givenHttpHeaders
contain a valid authorization, or if the underlyingChannel
has already been authenticated When returningfalse
, this method MUST NOT send a response to the client- Specified by:
isAuthorized
in interfaceHttpAuthenticationHandler
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionheaders
- TheHttpHeaders
to check- Returns:
- otherwise
-