public abstract class AuthPolicy
extends java.lang.Object
The following specifications are provided:
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
AUTH_SCHEME_PRIORITY |
The key used to look up the list of IDs of supported
authentication schemes in their order of preference. |
static java.lang.String |
BASIC |
Basic authentication scheme as defined in RFC2617 (considered inherently
insecure, but most widely supported)
|
static java.lang.String |
DIGEST |
Digest authentication scheme as defined in RFC2617.
|
protected static org.apache.commons.logging.Log |
LOG |
Log object.
|
static java.lang.String |
NTLM |
The NTLM scheme is a proprietary Microsoft Windows Authentication
protocol (considered to be the most secure among currently supported
authentication schemes).
|
Constructor | Description |
---|---|
AuthPolicy() |
Modifier and Type | Method | Description |
---|---|---|
static AuthScheme |
getAuthScheme(java.lang.String id) |
Gets the
authentication scheme with the given ID. |
static java.util.List |
getDefaultAuthPrefs() |
Returns a list containing all registered
authentication
schemes in their default order. |
static void |
registerAuthScheme(java.lang.String id,
java.lang.Class clazz) |
Registers a class implementing an
authentication scheme with
the given identifier. |
static void |
unregisterAuthScheme(java.lang.String id) |
Unregisters the class implementing an
authentication scheme with
the given ID. |
public static final java.lang.String AUTH_SCHEME_PRIORITY
authentication schemes
in their order of preference. The scheme IDs are
stored in a Collection
as String
s.
If several schemes are returned in the WWW-Authenticate
or Proxy-Authenticate header, this parameter defines which
authentication schemes
takes precedence over others.
The first item in the collection represents the most preferred
authentication scheme
, the last item represents the ID
of the least preferred one.
DefaultHttpParams
,
Constant Field Valuespublic static final java.lang.String NTLM
public static final java.lang.String DIGEST
public static final java.lang.String BASIC
protected static final org.apache.commons.logging.Log LOG
public static void registerAuthScheme(java.lang.String id, java.lang.Class clazz)
authentication scheme
with
the given identifier. If a class with the given ID already exists it will be overridden.
This ID is the same one used to retrieve the authentication scheme
from getAuthScheme(String)
.
Please note that custom authentication preferences, if used, need to be updated accordingly
for the new authentication scheme
to take effect.
id
- the identifier for this schemeclazz
- the class to registergetAuthScheme(String)
,
AUTH_SCHEME_PRIORITY
public static void unregisterAuthScheme(java.lang.String id)
authentication scheme
with
the given ID.id
- the ID of the class to unregisterpublic static AuthScheme getAuthScheme(java.lang.String id) throws java.lang.IllegalStateException
authentication scheme
with the given ID.id
- the authentication scheme
IDauthentication scheme
java.lang.IllegalStateException
- if a scheme with the ID cannot be foundpublic static java.util.List getDefaultAuthPrefs()
authentication
schemes
in their default order.authentication scheme
Copyright (c) 1999-2005 - Apache Software Foundation