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 TypeMethodDescriptionbooleanAlways returnstrue, since this handler is for No Authenticationstatic HttpNoAuthenticationHandlerinstance()Gets a handler instancevoidInvalidates the authentication of the specifiedChannelHandlerContext, if supported by the authentication handlerbooleanisAuthorized(ChannelHandlerContext ctx, FullHttpRequest req) Checks if the givenFullHttpRequestis a valid authentication request, or if the underlyingChannelhas already been authenticated When returningfalse, this method MUST NOT send a response to the clientbooleanisAuthorized(ChannelHandlerContext ctx, HttpHeaders headers) Checks if the givenHttpHeaderscontain a valid authorization, or if the underlyingChannelhas already been authenticated When returningfalse, this method MUST NOT send a response to the clientbooleanisAuthorized(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:
checkAuthorizationin interfaceHttpAuthenticationHandler- Parameters:
ctx- TheChannelHandlerContextof the sessionreq- TheFullHttpRequestof the request- Returns:
-
invalidateAuthorization
Description copied from interface:HttpAuthenticationHandlerInvalidates the authentication of the specifiedChannelHandlerContext, if supported by the authentication handler- Specified by:
invalidateAuthorizationin interfaceHttpAuthenticationHandler- Parameters:
ctx- TheChannelHandlerContextof the sessionreq- TheFullHttpRequest
-
isAuthorized
Description copied from interface:HttpAuthenticationHandlerChecks if the givenFullHttpRequestis a valid authentication request, or if the underlyingChannelhas already been authenticated When returningfalse, this method MUST NOT send a response to the client- Specified by:
isAuthorizedin interfaceHttpAuthenticationHandler- Parameters:
ctx- TheChannelHandlerContextof the sessionreq- TheFullHttpRequestto check- Returns:
- otherwise
-
isAuthorized
Description copied from interface:HttpAuthenticationHandlerChecks if the given username and password is a valid When returningfalse, this method MUST NOT send a response to the client- Specified by:
isAuthorizedin interfaceHttpAuthenticationHandler- Parameters:
user- The usernamepass- The password- Returns:
- otherwise
-
isAuthorized
Description copied from interface:HttpAuthenticationHandlerChecks if the givenHttpHeaderscontain a valid authorization, or if the underlyingChannelhas already been authenticated When returningfalse, this method MUST NOT send a response to the client- Specified by:
isAuthorizedin interfaceHttpAuthenticationHandler- Parameters:
ctx- TheChannelHandlerContextof the sessionheaders- TheHttpHeadersto check- Returns:
- otherwise
-