Class BasicAuthenticator.BasicCredentials
java.lang.Object
org.apache.catalina.authenticator.BasicAuthenticator.BasicCredentials
- Enclosing class:
- BasicAuthenticator
Parser for an HTTP Authorization header for BASIC authentication as per RFC 2617 section 2, and the Base64
 encoded credentials as per RFC 2045 section 6.8.
- 
Constructor SummaryConstructorsConstructorDescriptionBasicCredentials(ByteChunk input, Charset charset) Parse the HTTP Authorization header for BASIC authentication as per RFC 7617.BasicCredentials(ByteChunk input, Charset charset, boolean trimCredentials) Deprecated.Will be removed in Tomcat 11 onwards
- 
Method SummaryModifier and TypeMethodDescriptionTrivial accessor.Trivial accessor.
- 
Constructor Details- 
BasicCredentialsParse the HTTP Authorization header for BASIC authentication as per RFC 7617.- Parameters:
- input- The header value to parse in-place
- charset- The character set to use to convert the bytes to a string
- Throws:
- IllegalArgumentException- If the header does not conform to RFC 7617
 
- 
BasicCredentials@Deprecated public BasicCredentials(ByteChunk input, Charset charset, boolean trimCredentials) throws IllegalArgumentException Deprecated.Will be removed in Tomcat 11 onwardsParse the HTTP Authorization header for BASIC authentication as per RFC 7617.- Parameters:
- input- The header value to parse in-place
- charset- The character set to use to convert the bytes to a string
- trimCredentials- Should leading and trailing whitespace be removed from the parsed credentials
- Throws:
- IllegalArgumentException- If the header does not conform to RFC 7617
 
 
- 
- 
Method Details- 
getUsernameTrivial accessor.- Returns:
- the decoded username token as a String, which is never be null, but can be empty.
 
- 
getPasswordTrivial accessor.- Returns:
- the decoded password token as a String, or nullif no password was found in the credentials.
 
 
-