|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.luigidragone.net.ntlm.NTLMAuthorizationHandler
This is an NTLM protocol authorization module for HTTPClient.
NTLM is a Microsoft proprietary network authentication protocol used in many situations and HTTPClient is a versatile and extendible component for implementing HTTP client applications.
This class relies on NTLM
class and on HTTPClient package.
It also requires a JCE compliant library (e.g.,
Cryptix JCE) that implements MD4 and DES algorithms.
Use these data as argument to class constructor to create a new authorization
object:
HTTPClient.AuthorizationHandler ntlm = new NTLMAuthorizationHandler(host, hostDomain, user, userDomain, password); HTTPClient.AuthorizationInfo.setAuthHandler(ntlm);If the client is behind a proxy server, set accordingly the system properties http.proxyHost and http.proxyPort. The authorization handler must be set before opening any connection, thus it could be done in a (static or instance) initializer or in a constructor. After the setting of the authorization handler HTTP connections can be used as usual.
Constructor Summary | |
NTLMAuthorizationHandler()
Build an NTLM authorization handler for the authentication credentials specified by system properties. |
|
NTLMAuthorizationHandler(java.lang.String host,
java.lang.String hostDomain,
java.lang.String user,
java.lang.String userDomain,
byte[] lmPassword,
byte[] ntPassword)
Build an NTLM authorization handler for the specified authentication credentials. |
|
NTLMAuthorizationHandler(java.lang.String host,
java.lang.String hostDomain,
java.lang.String user,
java.lang.String userDomain,
java.lang.String password)
Build an NTLM authorization handler for the specified authentication credentials. |
Method Summary | |
HTTPClient.AuthorizationInfo |
fixupAuthInfo(HTTPClient.AuthorizationInfo parm1,
HTTPClient.RoRequest parm2,
HTTPClient.AuthorizationInfo parm3,
HTTPClient.RoResponse parm4)
|
HTTPClient.AuthorizationInfo |
getAuthorization(HTTPClient.AuthorizationInfo parm1,
HTTPClient.RoRequest parm2,
HTTPClient.RoResponse parm3)
|
void |
handleAuthHeaders(HTTPClient.Response parm1,
HTTPClient.RoRequest parm2,
HTTPClient.AuthorizationInfo parm3,
HTTPClient.AuthorizationInfo parm4)
|
void |
handleAuthTrailers(HTTPClient.Response parm1,
HTTPClient.RoRequest parm2,
HTTPClient.AuthorizationInfo parm3,
HTTPClient.AuthorizationInfo parm4)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NTLMAuthorizationHandler() throws java.lang.IllegalArgumentException, javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException
Build an NTLM authorization handler for the authentication credentials specified by system properties.
To specify the authentication information set accordingly the following properties:
java.lang.IllegalArgumentException
- if a required property is undefined
javax.crypto.NoSuchPaddingException
- if there isn't any suitable padding method
java.security.NoSuchAlgorithmException
- if there isn't any suitable cipher algorithmpublic NTLMAuthorizationHandler(java.lang.String host, java.lang.String hostDomain, java.lang.String user, java.lang.String userDomain, byte[] lmPassword, byte[] ntPassword) throws java.lang.IllegalArgumentException
Build an NTLM authorization handler for the specified authentication credentials.
All the arguments are mandatory (null value are not allowed).
host
- the name of the host that is authenticatinghostDomain
- the name of the domain to which the host belongsuser
- the name of the useruserDomain
- the name of the domain to which the user belongslmPassword
- a 16-bytes array containing the Lan Manager hashed passwordntPassword
- a 16-bytes array containing the NT hashed password
java.lang.IllegalArgumentException
- if a supplied argument is invalidpublic NTLMAuthorizationHandler(java.lang.String host, java.lang.String hostDomain, java.lang.String user, java.lang.String userDomain, java.lang.String password) throws java.lang.IllegalArgumentException, javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException
Build an NTLM authorization handler for the specified authentication credentials.
All the arguments are mandatory (null value are not allowed).
host
- the name of the host that is authenticatinghostDomain
- the name of the domain to which the host belongsuser
- the name of the useruserDomain
- the name of the domain to which the user belongspassword
- the user's password
java.lang.IllegalArgumentException
- if a supplied argument is invalid
javax.crypto.NoSuchPaddingException
- if there isn't any suitable padding method
java.security.NoSuchAlgorithmException
- if there isn't any suitable cipher algorithmMethod Detail |
public HTTPClient.AuthorizationInfo getAuthorization(HTTPClient.AuthorizationInfo parm1, HTTPClient.RoRequest parm2, HTTPClient.RoResponse parm3) throws HTTPClient.AuthSchemeNotImplException, java.io.IOException
getAuthorization
in interface HTTPClient.AuthorizationHandler
HTTPClient.AuthSchemeNotImplException
java.io.IOException
public HTTPClient.AuthorizationInfo fixupAuthInfo(HTTPClient.AuthorizationInfo parm1, HTTPClient.RoRequest parm2, HTTPClient.AuthorizationInfo parm3, HTTPClient.RoResponse parm4) throws HTTPClient.AuthSchemeNotImplException, java.io.IOException
fixupAuthInfo
in interface HTTPClient.AuthorizationHandler
HTTPClient.AuthSchemeNotImplException
java.io.IOException
public void handleAuthHeaders(HTTPClient.Response parm1, HTTPClient.RoRequest parm2, HTTPClient.AuthorizationInfo parm3, HTTPClient.AuthorizationInfo parm4) throws java.io.IOException
handleAuthHeaders
in interface HTTPClient.AuthorizationHandler
java.io.IOException
public void handleAuthTrailers(HTTPClient.Response parm1, HTTPClient.RoRequest parm2, HTTPClient.AuthorizationInfo parm3, HTTPClient.AuthorizationInfo parm4) throws java.io.IOException
handleAuthTrailers
in interface HTTPClient.AuthorizationHandler
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |