| Modifier and Type | Field and Description |
|---|---|
| pack-priv AuthScheme | authScheme
The authentication scheme (basic/digest). |
| pack-priv String | host
The host we're authenticating against. |
| pack-priv String | path
The shortest path from the URL we authenticated against. |
| pack-priv int | port
The port on the host we're authenticating against. |
| pack-priv String | protocol
The protocol/scheme (i.e. http or https ). |
| public static final char | |
| protected PasswordAuthentication | |
| pack-priv String | realm
The realm we're authenticating against. |
| private static final Condition | |
| private static final ReentrantLock | |
| private static final HashMap | requests
requests is used to ensure that interaction with the Authenticator for a particular realm is single threaded. |
| pack-priv static final boolean | serializeAuth
If true, then simultaneous authentication requests to the same realm/proxy are serialized, in order to avoid a user having to type the same username/passwords repeatedly, via the Authenticator. |
| public static final char | |
| pack-priv char | type
The type (server/proxy) of authentication this is. |
| Access | Constructor and Description |
|---|---|
| public | AuthenticationInfo(char type, AuthScheme authScheme, String host, int port, String realm)
Use this constructor only for proxy entries |
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv String | cacheKey(boolean
if you want the realm considered. Preemptively
setting an authorization is done before the realm is known. includeRealm)Give a key for hash table lookups. |
| public Object | |
| public PasswordAuthentication | credentials()
Implements abstract sun. the credentials associated with this authentication |
| public void | |
| pack-priv static void | |
| pack-priv static AuthenticationInfo | getAuth(String key, URL url, AuthCacheImpl acache)
Return the AuthenticationInfo object from the cache if it's path is a substring of the supplied URLs path. |
| pack-priv AuthScheme | getAuthScheme()
Implements abstract sun. Authentication scheme |
| public AuthCacheValue. | getAuthType()
Implements abstract sun. Proxy or Server |
| private static AuthenticationInfo | |
| private static AuthenticationInfo | |
| public String | |
| public abstract String | Returns: the value of the HTTP header this authentication wants set. Used for preemptive authorization.The URL url, String The request method method)Calculates and returns the authentication header value based on the stored authentication parameters. |
| public String | |
| public String | getPath()
Implements abstract sun. root path of realm or the request path if the root is not known yet. |
| public int | getPort()
Implements abstract sun. portnumber of server/proxy |
| public String | getProtocolScheme()
Implements abstract sun. returns http or https |
| pack-priv static AuthenticationInfo | getProxyAuth(String host, int port, AuthCacheImpl acache)
Returns a firewall authentication, for the given host/port. |
| pack-priv static AuthenticationInfo | |
| pack-priv static String | getProxyAuthKey(String host, int port, String realm, AuthScheme scheme)
Returns a firewall authentication, for the given host/port and realm. |
| public String | getRealm()
Implements abstract sun. realm of authentication if known |
| pack-priv static AuthenticationInfo | |
| pack-priv static AuthenticationInfo | |
| pack-priv static String | getServerAuthKey(URL url, String realm, AuthScheme scheme)
Returns info for the URL, for an HTTP server auth. |
| public abstract boolean | |
| pack-priv static String | |
| pack-priv void | |
| private static AuthenticationInfo | requestAuthentication(String key, AuthCacheImpl acache, BiFunction<String, AuthCacheImpl, AuthenticationInfo> cachefunc)
|
| private static void | |
| public abstract void | setHeaders(HttpURLConnection
The connection to apply the header(s) to conn, HeaderParser A source of header values for this connection, if needed. p, String The raw header field (if needed) raw)Set header(s) on the given connection. |
| public abstract boolean | supportsPreemptiveAuthorization()
Returns: true if this authentication supports preemptive authorization |
| protected boolean |
| authScheme | back to summary |
|---|---|
| pack-priv AuthScheme authScheme The authentication scheme (basic/digest). Also used for key lookup | |
| host | back to summary |
|---|---|
| pack-priv String host The host we're authenticating against. | |
| path | back to summary |
|---|---|
| pack-priv String path The shortest path from the URL we authenticated against. | |
| port | back to summary |
|---|---|
| pack-priv int port The port on the host we're authenticating against. | |
| protocol | back to summary |
|---|---|
| pack-priv String protocol The protocol/scheme (i.e. http or https ). Need to keep the caches logically separate for the two protocols. This field is only used when constructed with a URL (the normal case for server authentication) For proxy authentication the protocol is not relevant. | |
| PROXY_AUTHENTICATION | back to summary |
|---|---|
| public static final char PROXY_AUTHENTICATION | |
| pw | back to summary |
|---|---|
| protected PasswordAuthentication pw | |
| realm | back to summary |
|---|---|
| pack-priv String realm The realm we're authenticating against. | |
| requestFinished | back to summary |
|---|---|
| private static final Condition requestFinished | |
| requestLock | back to summary |
|---|---|
| private static final ReentrantLock requestLock | |
| requests | back to summary |
|---|---|
| private static final HashMap<String, Thread> requests requests is used to ensure that interaction with the Authenticator for a particular realm is single threaded. i.e. if multiple threads need to get credentials from the user at the same time, then all but the first will block until the first completes its authentication. | |
| serializeAuth | back to summary |
|---|---|
| pack-priv static final boolean serializeAuth If true, then simultaneous authentication requests to the same realm/proxy are serialized, in order to avoid a user having to type the same username/passwords repeatedly, via the Authenticator. Default is false, which means that this behavior is switched off. | |
| SERVER_AUTHENTICATION | back to summary |
|---|---|
| public static final char SERVER_AUTHENTICATION | |
| type | back to summary |
|---|---|
| pack-priv char type The type (server/proxy) of authentication this is. Used for key lookup | |
| AuthenticationInfo | back to summary |
|---|---|
| public AuthenticationInfo(char type, AuthScheme authScheme, String host, int port, String realm) Use this constructor only for proxy entries | |
| AuthenticationInfo | back to summary |
|---|---|
| public AuthenticationInfo(char type, AuthScheme authScheme, URL url, String realm) | |
| addToCache | back to summary |
|---|---|
| pack-priv void addToCache(AuthCacheImpl authcache) Add this authentication to the cache | |
| cacheKey | back to summary |
|---|---|
| pack-priv String cacheKey(boolean includeRealm) Give a key for hash table lookups.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| credentials | back to summary |
|---|---|
| public PasswordAuthentication credentials() Implements abstract sun. Doc from sun. the credentials associated with this authentication | |
| disposeContext | back to summary |
|---|---|
| public void disposeContext() Releases any system or cryptographic resources. It is up to implementors to override disposeContext() to take necessary action. | |
| endAuthRequest | back to summary |
|---|---|
| pack-priv static void endAuthRequest(String key) | |
| getAuth | back to summary |
|---|---|
| pack-priv static AuthenticationInfo getAuth(String key, URL url, AuthCacheImpl acache) Return the AuthenticationInfo object from the cache if it's path is a substring of the supplied URLs path. | |
| getAuthScheme | back to summary |
|---|---|
| pack-priv AuthScheme getAuthScheme() Implements abstract sun. Doc from sun. Authentication scheme | |
| getAuthType | back to summary |
|---|---|
| public AuthCacheValue. Implements abstract sun. Doc from sun. Proxy or Server | |
| getCachedProxyAuth | back to summary |
|---|---|
| private static AuthenticationInfo getCachedProxyAuth(String key, AuthCacheImpl acache) | |
| getCachedServerAuth | back to summary |
|---|---|
| private static AuthenticationInfo getCachedServerAuth(String key, AuthCacheImpl cache) | |
| getHeaderName | back to summary |
|---|---|
public String getHeaderName()
| |
| getHeaderValue | back to summary |
|---|---|
| public abstract String getHeaderValue(URL url, String method) Calculates and returns the authentication header value based on the stored authentication parameters. If the calculation does not depend on the URL or the request method then these parameters are ignored. | |
| getHost | back to summary |
|---|---|
| public String getHost() Implements abstract sun. Doc from sun. name of server/proxy | |
| getPath | back to summary |
|---|---|
| public String getPath() Implements abstract sun. Doc from sun. root path of realm or the request path if the root is not known yet. | |
| getPort | back to summary |
|---|---|
| public int getPort() Implements abstract sun. Doc from sun. portnumber of server/proxy | |
| getProtocolScheme | back to summary |
|---|---|
| public String getProtocolScheme() Implements abstract sun. Doc from sun. returns http or https | |
| getProxyAuth | back to summary |
|---|---|
| pack-priv static AuthenticationInfo getProxyAuth(String host, int port, AuthCacheImpl acache) Returns a firewall authentication, for the given host/port. Used for preemptive header-setting. Note, the protocol field is always blank for proxies. | |
| getProxyAuth | back to summary |
|---|---|
| pack-priv static AuthenticationInfo getProxyAuth(String key, AuthCacheImpl acache) | |
| getProxyAuthKey | back to summary |
|---|---|
| pack-priv static String getProxyAuthKey(String host, int port, String realm, AuthScheme scheme) Returns a firewall authentication, for the given host/port and realm. Used in response to a challenge. Note, the protocol field is always blank for proxies. | |
| getRealm | back to summary |
|---|---|
| public String getRealm() Implements abstract sun. Doc from sun. realm of authentication if known | |
| getServerAuth | back to summary |
|---|---|
| pack-priv static AuthenticationInfo getServerAuth(URL url, AuthCacheImpl cache) Returns info for the URL, for an HTTP server auth. Used when we don't yet know the realm (i.e. when we're preemptively setting the auth). | |
| getServerAuth | back to summary |
|---|---|
| pack-priv static AuthenticationInfo getServerAuth(String key, AuthCacheImpl cache) | |
| getServerAuthKey | back to summary |
|---|---|
| pack-priv static String getServerAuthKey(URL url, String realm, AuthScheme scheme) Returns info for the URL, for an HTTP server auth. Used when we do know the realm (i.e. when we're responding to a challenge). In this case we do not use the path because the protection space is identified by the host:port:realm only | |
| isAuthorizationStale | back to summary |
|---|---|
| public abstract boolean isAuthorizationStale(String header) Check if the header indicates that the current auth. parameters are stale. If so, then replace the relevant field with the new value and return true. Otherwise return false. returning true means the request can be retried with the same userid/password returning false means we have to go back to the user to ask for a new username password. | |
| reducePath | back to summary |
|---|---|
| pack-priv static String reducePath(String urlPath) | |
| removeFromCache | back to summary |
|---|---|
| pack-priv void removeFromCache(AuthCacheImpl authcache) Remove this authentication from the cache | |
| requestAuthentication | back to summary |
|---|---|
| private static AuthenticationInfo requestAuthentication(String key, AuthCacheImpl acache, BiFunction<String, AuthCacheImpl, AuthenticationInfo> cachefunc) | |
| requestCompleted | back to summary |
|---|---|
| private static void requestCompleted(String key) | |
| setHeaders | back to summary |
|---|---|
| public abstract void setHeaders(HttpURLConnection conn, HeaderParser p, String raw) throws IOException Set header(s) on the given connection. Subclasses must override This will only be called for definitive (i.e. non-preemptive) authorization.
| |
| supportsPreemptiveAuthorization | back to summary |
|---|---|
public abstract boolean supportsPreemptiveAuthorization()
| |
| useAuthCache | back to summary |
|---|---|
| protected boolean useAuthCache() Whether we should cache this instance in the AuthCache.
This method returns
| |