Class BasicAuthenticationConverter
- java.lang.Object
-
- org.springframework.security.web.authentication.www.BasicAuthenticationConverter
-
- All Implemented Interfaces:
AuthenticationConverter
public class BasicAuthenticationConverter extends java.lang.Object implements AuthenticationConverter
Converts from a HttpServletRequest toUsernamePasswordAuthenticationToken
that can be authenticated. Null authentication possible if there was no Authorization header with Basic authentication scheme.- Since:
- 5.2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUTHENTICATION_SCHEME_BASIC
-
Constructor Summary
Constructors Constructor Description BasicAuthenticationConverter()
BasicAuthenticationConverter(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UsernamePasswordAuthenticationToken
convert(javax.servlet.http.HttpServletRequest request)
AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?>
getAuthenticationDetailsSource()
java.nio.charset.Charset
getCredentialsCharset()
protected java.nio.charset.Charset
getCredentialsCharset(javax.servlet.http.HttpServletRequest request)
void
setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
void
setCredentialsCharset(java.nio.charset.Charset credentialsCharset)
-
-
-
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(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 AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> getAuthenticationDetailsSource()
-
setAuthenticationDetailsSource
public void setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
-
convert
public UsernamePasswordAuthenticationToken convert(javax.servlet.http.HttpServletRequest request)
- Specified by:
convert
in interfaceAuthenticationConverter
-
getCredentialsCharset
protected java.nio.charset.Charset getCredentialsCharset(javax.servlet.http.HttpServletRequest request)
-
-