APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.www.protocol.http.ntlm

public final Class NTLMAuthentication

extends AuthenticationInfo
Class Inheritance
Imports
com.sun.security.ntlm.Client, .NTLMException, java.io.IOException, java.net.InetAddress, .PasswordAuthentication, .UnknownHostException, .URL, java.security.GeneralSecurityException, java.util.Base64, .Locale, sun.net.www.HeaderParser, sun.net.www.protocol.http.AuthenticationInfo, .AuthScheme, .HttpURLConnection

NTLMAuthentication:
Author
Michael McMahon

Field Summary

Modifier and TypeField and Description
pack-priv Client
private static final String
private String
private static final NTLMAuthenticationCallback
private static final boolean
pack-priv PasswordAuthentication
Inherited from sun.net.www.protocol.http.AuthenticationInfo:
PROXY_AUTHENTICATIONSERVER_AUTHENTICATION

Constructor Summary

AccessConstructor and Description
public
NTLMAuthentication(boolean isProxy, URL url, PasswordAuthentication pw)

Create a NTLMAuthentication: Username may be specified as domain<BACKSLASH>username in the application Authenticator.

public
NTLMAuthentication(boolean isProxy, String host, int port, PasswordAuthentication pw)

Constructor used for proxy entries

Method Summary

Modifier and TypeMethod and Description
private String
private String
buildType3Msg(String challenge)

public String
private void
public boolean
isAuthorizationStale(String header)

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.isAuthorizationStale.

Check if the header indicates that the current auth.

public static boolean
isTrustedSite(URL url)

Returns true if the given site is trusted, i.e. we can try transparent Authentication.

public void
setHeaders(HttpURLConnection
The connection to apply the header(s) to
conn
,
HeaderParser
A source of header values for this connection, not used because HeaderParser converts the fields to lower case, use raw instead
p
,
String
The raw header field.
raw
)

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.setHeaders.

Set header(s) on the given connection.

public boolean
supportsPreemptiveAuthorization()

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.supportsPreemptiveAuthorization.

Returns: true if this authentication supports preemptive authorization

public static boolean
protected boolean
useAuthCache()

Overrides sun.net.www.protocol.http.AuthenticationInfo.useAuthCache.

Whether we should cache this instance in the AuthCache.

Inherited from sun.net.www.protocol.http.AuthenticationInfo:
clonecredentialsdisposeContextgetAuthTypegetHeaderNamegetHostgetPathgetPortgetProtocolSchemegetRealm

Field Detail

clientback to summary
pack-priv Client client
defaultDomainback to summary
private static final String defaultDomain
hostnameback to summary
private String hostname
NTLMAuthCallbackback to summary
private static final NTLMAuthenticationCallback NTLMAuthCallback
ntlmCacheback to summary
private static final boolean ntlmCache
pwback to summary
pack-priv PasswordAuthentication pw

Hides sun.net.www.protocol.http.AuthenticationInfo.pw.

Constructor Detail

NTLMAuthenticationback to summary
public NTLMAuthentication(boolean isProxy, URL url, PasswordAuthentication pw)

Create a NTLMAuthentication: Username may be specified as domain<BACKSLASH>username in the application Authenticator. If this notation is not used, then the domain will be taken from a system property: "http.auth.ntlm.domain".

NTLMAuthenticationback to summary
public NTLMAuthentication(boolean isProxy, String host, int port, PasswordAuthentication pw)

Constructor used for proxy entries

Method Detail

buildType1Msgback to summary
private String buildType1Msg()
buildType3Msgback to summary
private String buildType3Msg(String challenge) throws GeneralSecurityException
getHeaderValueback to summary
public String getHeaderValue(URL url, String method)

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.getHeaderValue.

Not supported. Must use the setHeaders() method

Annotations
@Override
initback to summary
private void init(PasswordAuthentication pw)
isAuthorizationStaleback to summary
public boolean isAuthorizationStale(String header)

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.isAuthorizationStale.

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.

Annotations
@Override
isTrustedSiteback to summary
public static boolean isTrustedSite(URL url)

Returns true if the given site is trusted, i.e. we can try transparent Authentication. Shouldn't be called since capability not supported on Unix

setHeadersback to summary
public void setHeaders(HttpURLConnection conn, HeaderParser p, String raw) throws IOException

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.setHeaders.

Set header(s) on the given connection.

Parameters
conn:HttpURLConnection

The connection to apply the header(s) to

p:HeaderParser

A source of header values for this connection, not used because HeaderParser converts the fields to lower case, use raw instead

raw:String

The raw header field.

Annotations
@Override
Exceptions
IOException:
if no headers were set
supportsPreemptiveAuthorizationback to summary
public boolean supportsPreemptiveAuthorization()

Implements abstract sun.net.www.protocol.http.AuthenticationInfo.supportsPreemptiveAuthorization.

Returns:boolean

true if this authentication supports preemptive authorization

Annotations
@Override
supportsTransparentAuthback to summary
public static boolean supportsTransparentAuth()
useAuthCacheback to summary
protected boolean useAuthCache()

Overrides sun.net.www.protocol.http.AuthenticationInfo.useAuthCache.

Doc from sun.net.www.protocol.http.AuthenticationInfo.useAuthCache.

Whether we should cache this instance in the AuthCache. This method returns true by default. Subclasses may override this method to add additional restrictions.

Annotations
@Override