Class BasicAuthenticationHandler
java.lang.Object
org.codice.ddf.security.handler.basic.BasicAuthenticationHandler
- All Implemented Interfaces:
org.codice.ddf.security.handler.api.AuthenticationHandler
public class BasicAuthenticationHandler
extends Object
implements org.codice.ddf.security.handler.api.AuthenticationHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.shiro.authc.AuthenticationTokenextractAuthenticationInfo(javax.servlet.http.HttpServletRequest request) protected org.apache.shiro.authc.AuthenticationTokenextractAuthInfo(String authHeader, String ip) Extract the Authorization header and parse into a username/password token.org.codice.ddf.security.handler.api.HandlerResultgetNormalizedToken(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, org.codice.ddf.platform.filter.SecurityFilterChain chain, boolean resolve) Processes the incoming request to retrieve the username/password tokens.org.codice.ddf.security.handler.api.HandlerResulthandleError(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, org.codice.ddf.platform.filter.SecurityFilterChain chain)
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
BasicAuthenticationHandler
public BasicAuthenticationHandler()
-
-
Method Details
-
getAuthenticationType
- Specified by:
getAuthenticationTypein interfaceorg.codice.ddf.security.handler.api.AuthenticationHandler
-
getNormalizedToken
public org.codice.ddf.security.handler.api.HandlerResult getNormalizedToken(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, org.codice.ddf.platform.filter.SecurityFilterChain chain, boolean resolve) Processes the incoming request to retrieve the username/password tokens. Handles responding to the client that authentication is needed if they are not present in the request. Returns theHandlerResultfor the HTTP Request.- Specified by:
getNormalizedTokenin interfaceorg.codice.ddf.security.handler.api.AuthenticationHandler- Parameters:
request- http request to obtain attributes from and to pass into any local filter chains requiredresponse- http response to return http responses or redirectschain- original filter chain (should not be called from your handler)resolve- flag with true implying that credentials should be obtained, false implying return if no credentials are found.- Returns:
-
handleError
public org.codice.ddf.security.handler.api.HandlerResult handleError(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, org.codice.ddf.platform.filter.SecurityFilterChain chain) - Specified by:
handleErrorin interfaceorg.codice.ddf.security.handler.api.AuthenticationHandler
-
extractAuthenticationInfo
protected org.apache.shiro.authc.AuthenticationToken extractAuthenticationInfo(javax.servlet.http.HttpServletRequest request) -
extractAuthInfo
Extract the Authorization header and parse into a username/password token.- Parameters:
authHeader- the authHeader string from the HTTP request- Returns:
- the initialized STSAuthenticationToken for this username and password combination (or null)
-