public static class BasicAuthenticator.BasicCredentials extends Object
Constructor and Description |
---|
BasicCredentials(ByteChunk input,
Charset charset)
Deprecated.
Unused. Will be removed in Tomcat 10. Use 3-arg constructor
|
BasicCredentials(ByteChunk input,
Charset charset,
boolean trimCredentials)
Parse the HTTP Authorization header for BASIC authentication
as per RFC 2617 section 2, and the Base64 encoded credentials
as per RFC 2045 section 6.8.
|
Modifier and Type | Method and Description |
---|---|
String |
getPassword()
Trivial accessor.
|
String |
getUsername()
Trivial accessor.
|
@Deprecated public BasicCredentials(ByteChunk input, Charset charset) throws IllegalArgumentException
input
- The header value to parse in-placecharset
- The character set to use to convert the bytes to a
stringIllegalArgumentException
- If the header does not conform
to RFC 2617public BasicCredentials(ByteChunk input, Charset charset, boolean trimCredentials) throws IllegalArgumentException
input
- The header value to parse in-placecharset
- The character set to use to convert the bytes
to a stringtrimCredentials
- Should leading and trailing whitespace be
removed from the parsed credentialsIllegalArgumentException
- If the header does not conform
to RFC 2617public String getUsername()
null
, but can be empty.public String getPassword()
null
if no password was found in the credentials.Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.