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
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.shiro.authc.AuthenticationToken
    extractAuthenticationInfo(javax.servlet.http.HttpServletRequest request)
     
    protected org.apache.shiro.authc.AuthenticationToken
    extractAuthInfo(String authHeader, String ip)
    Extract the Authorization header and parse into a username/password token.
     
    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.
    org.codice.ddf.security.handler.api.HandlerResult
    handleError(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, org.codice.ddf.platform.filter.SecurityFilterChain chain)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
  • Constructor Details

    • BasicAuthenticationHandler

      public BasicAuthenticationHandler()
  • Method Details

    • getAuthenticationType

      public String getAuthenticationType()
      Specified by:
      getAuthenticationType in interface org.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 the HandlerResult for the HTTP Request.
      Specified by:
      getNormalizedToken in interface org.codice.ddf.security.handler.api.AuthenticationHandler
      Parameters:
      request - http request to obtain attributes from and to pass into any local filter chains required
      response - http response to return http responses or redirects
      chain - 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:
      handleError in interface org.codice.ddf.security.handler.api.AuthenticationHandler
    • extractAuthenticationInfo

      protected org.apache.shiro.authc.AuthenticationToken extractAuthenticationInfo(javax.servlet.http.HttpServletRequest request)
    • extractAuthInfo

      protected org.apache.shiro.authc.AuthenticationToken extractAuthInfo(String authHeader, String ip)
      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)