Package jcifs.smb
Class SmbSession
- java.lang.Object
-
- jcifs.smb.SmbSession
-
public final class SmbSession extends java.lang.Object
The class represents a user's session established with an SMB/CIFS server. This class is used internally to the jCIFS library however applications may wish to authenticate aribrary user credentials with the logon method. It is noteworthy that jCIFS does not support DCE/RPC at this time and therefore does not use the NETLOGON procedure. Instead, it simply performs a "tree connect" to IPC$ using the supplied credentials. This is only a subset of the NETLOGON procedure but is achives the same effect. Note that it is possible to change the resource against which clients are authenticated to be something other than IPC$ using the jcifs.smb.client.logonShare property. This can be used to provide simple group based access control. For example, one could setup the NTLM HTTP Filter with the jcifs.smb.client.domainController init parameter set to the name of the server used for authentication. On that host, create a share called JCIFSAUTH and adjust the access control list for that share to permit only the clients that should have access to the target website. Finally, set the jcifs.smb.client.logonShare to JCIFSAUTH. This should restrict access to only those clients that have access to the JCIFSAUTH share. The access control on that share can be changed without changing init parameters or reinitializing the webapp.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]
getChallenge(UniAddress dc)
static byte[]
getChallenge(UniAddress dc, int port)
static NtlmChallenge
getChallengeForDomain()
static void
logon(UniAddress dc, int port, NtlmPasswordAuthentication auth)
static void
logon(UniAddress dc, NtlmPasswordAuthentication auth)
Authenticate arbitrary credentials represented by the NtlmPasswordAuthentication object against the domain controller specified by the UniAddress parameter.java.lang.String
toString()
-
-
-
Method Detail
-
getChallengeForDomain
public static NtlmChallenge getChallengeForDomain() throws SmbException, java.net.UnknownHostException
- Throws:
SmbException
java.net.UnknownHostException
-
getChallenge
public static byte[] getChallenge(UniAddress dc) throws SmbException, java.net.UnknownHostException
- Throws:
SmbException
java.net.UnknownHostException
-
getChallenge
public static byte[] getChallenge(UniAddress dc, int port) throws SmbException, java.net.UnknownHostException
- Throws:
SmbException
java.net.UnknownHostException
-
logon
public static void logon(UniAddress dc, NtlmPasswordAuthentication auth) throws SmbException
Authenticate arbitrary credentials represented by the NtlmPasswordAuthentication object against the domain controller specified by the UniAddress parameter. If the credentials are not accepted, an SmbAuthException will be thrown. If an error occurs an SmbException will be thrown. If the credentials are valid, the method will return without throwing an exception. See the last FAQ question. See also the jcifs.smb.client.logonShare property.- Throws:
SmbException
-
logon
public static void logon(UniAddress dc, int port, NtlmPasswordAuthentication auth) throws SmbException
- Throws:
SmbException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-