Class BasicAuthenticationConverter

java.lang.Object
org.springframework.security.web.authentication.www.BasicAuthenticationConverter
All Implemented Interfaces:
AuthenticationConverter

public class BasicAuthenticationConverter extends Object implements AuthenticationConverter
Converts from a HttpServletRequest to UsernamePasswordAuthenticationToken that can be authenticated. Null authentication possible if there was no Authorization header with Basic authentication scheme.
Since:
5.2.0
  • Field Details

  • Constructor Details

    • BasicAuthenticationConverter

      public BasicAuthenticationConverter()
    • BasicAuthenticationConverter

      public BasicAuthenticationConverter(AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
  • Method Details

    • getCredentialsCharset

      public Charset getCredentialsCharset()
    • setCredentialsCharset

      public void setCredentialsCharset(Charset credentialsCharset)
    • getAuthenticationDetailsSource

      public AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest,?> getAuthenticationDetailsSource()
    • setAuthenticationDetailsSource

      public void setAuthenticationDetailsSource(AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
    • convert

      public UsernamePasswordAuthenticationToken convert(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      convert in interface AuthenticationConverter
    • getCredentialsCharset

      protected Charset getCredentialsCharset(jakarta.servlet.http.HttpServletRequest request)