Class BasicAuthenticationConverter

  • All Implemented Interfaces:
    AuthenticationConverter

    public class BasicAuthenticationConverter
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.security.authentication.UsernamePasswordAuthenticationToken convert​(javax.servlet.http.HttpServletRequest request)  
      org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,​?> getAuthenticationDetailsSource()  
      java.nio.charset.Charset getCredentialsCharset()  
      protected java.nio.charset.Charset getCredentialsCharset​(javax.servlet.http.HttpServletRequest request)  
      void setAuthenticationDetailsSource​(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,​?> authenticationDetailsSource)  
      void setCredentialsCharset​(java.nio.charset.Charset credentialsCharset)  
      • Methods inherited from class java.lang.Object

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

      • AUTHENTICATION_SCHEME_BASIC

        public static final java.lang.String AUTHENTICATION_SCHEME_BASIC
        See Also:
        Constant Field Values
    • Constructor Detail

      • BasicAuthenticationConverter

        public BasicAuthenticationConverter()
      • BasicAuthenticationConverter

        public BasicAuthenticationConverter​(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,​?> authenticationDetailsSource)
    • Method Detail

      • getCredentialsCharset

        public java.nio.charset.Charset getCredentialsCharset()
      • setCredentialsCharset

        public void setCredentialsCharset​(java.nio.charset.Charset credentialsCharset)
      • getAuthenticationDetailsSource

        public org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,​?> getAuthenticationDetailsSource()
      • setAuthenticationDetailsSource

        public void setAuthenticationDetailsSource​(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,​?> authenticationDetailsSource)
      • convert

        public org.springframework.security.authentication.UsernamePasswordAuthenticationToken convert​(javax.servlet.http.HttpServletRequest request)
        Specified by:
        convert in interface AuthenticationConverter
      • getCredentialsCharset

        protected java.nio.charset.Charset getCredentialsCharset​(javax.servlet.http.HttpServletRequest request)