public class BasicCredentialsProvider extends Object implements CredentialsProvider
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_DEFAULT_HEADER_VALUE |
static String |
GUEST_DEFAULT_HEADER_VALUE |
Constructor and Description |
---|
BasicCredentialsProvider(String defaultHeaderValue)
Constructs a new BasicCredentialsProvider with the given default
value.
|
Modifier and Type | Method and Description |
---|---|
Credentials |
getCredentials(javax.servlet.http.HttpServletRequest request)
Extracts the credentials from the given servlet request.
|
public static final String EMPTY_DEFAULT_HEADER_VALUE
public static final String GUEST_DEFAULT_HEADER_VALUE
public BasicCredentialsProvider(String defaultHeaderValue)
getCredentials(javax.servlet.http.HttpServletRequest)
for details.defaultHeaderValue
- public Credentials getCredentials(javax.servlet.http.HttpServletRequest request) throws LoginException, javax.servlet.ServletException
Credentials
object for the given authorization header.
The creds may be used to login to the repository. If the specified header
string is null
the behaviour depends on the
defaultHeaderValue
field:null
, a LoginException is thrown.
This is suitable for clients (eg. webdav clients) for with
sending a proper authorization header is not possible, if the
server never send a 401.
If the request header is present but cannot be parsed a
ServletException
is thrown.
getCredentials
in interface CredentialsProvider
request
- the servlet requestnull
.javax.servlet.ServletException
- If the Authorization header cannot be decoded.LoginException
- if no suitable auth header and missing-auth-mapping
is not presentCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.