com.sibvisions.rad.server.security.ntlm
Class NtlmHelper

java.lang.Object
  extended by com.sibvisions.rad.server.security.ntlm.NtlmHelper

public final class NtlmHelper
extends Object

The NtlmHelper provides ntlm authentication through jcifs.


Method Summary
static NtlmHelper getInstance()
          Gets the current instance of NtlmHelper.
 NtlmSession getSession()
          Gets a session with for a domain controller with the adequate challenge.
 boolean isLoadBalance()
          Returns whether the load balance option will be used for authentication.
 NtlmAuthInfo logon()
          Logs on to a domaincontroller with the current credentials.
 NtlmAuthInfo logon(NtlmSession pSession, jcifs.smb.NtlmPasswordAuthentication pAuthentication)
          Logs on to a domaincontroller with prevalidated credentials.
 NtlmAuthInfo logon(String pDomain, String pUserName, String pPassword)
          Logs on to a domaincontroller with username and password.
 void setApplicatioName(String pApplicationName)
          Sets the application name where the configuration will be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NtlmHelper getInstance()
Gets the current instance of NtlmHelper.

Returns:
the singleton instance of NtlmHelper

setApplicatioName

public void setApplicatioName(String pApplicationName)
Sets the application name where the configuration will be found.

Parameters:
pApplicationName - the application name

isLoadBalance

public boolean isLoadBalance()
Returns whether the load balance option will be used for authentication.

Returns:
true if load balance will be used; otherwise false

getSession

public NtlmSession getSession()
                       throws Throwable
Gets a session with for a domain controller with the adequate challenge.

Returns:
the session
Throws:
Throwable - if it's not possible to detect a domain controller or challenge

logon

public NtlmAuthInfo logon(String pDomain,
                          String pUserName,
                          String pPassword)
                   throws Throwable
Logs on to a domaincontroller with username and password. The configured domain name will be used, if the username doesn't contain a domain information (DOAMIN\username).

Parameters:
pDomain - the domain for the logon
pUserName - the username
pPassword - the password
Returns:
the authentication information
Throws:
Throwable - if it is not possible to logon

logon

public NtlmAuthInfo logon()
                   throws Throwable
Logs on to a domaincontroller with the current credentials. The credentials will be detected automatically.

Returns:
the authentication information or null if it's not possible to log on with the credentials
Throws:
Throwable - if the credentials are valid but the logon failed

logon

public NtlmAuthInfo logon(NtlmSession pSession,
                          jcifs.smb.NtlmPasswordAuthentication pAuthentication)
                   throws Throwable
Logs on to a domaincontroller with prevalidated credentials.

Parameters:
pSession - the domaincontroller and challenge
pAuthentication - prevalidated credentials
Returns:
the authentication information
Throws:
Throwable - if it is not possible to logon


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.