java.lang.Object
org.codelibs.jcifs.smb1.NtlmAuthenticator
An abstract class for NTLM authentication in SMB1 protocol.
Provides a callback mechanism for retrieving user credentials when authentication is required.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NtlmPasswordAuthenticationAn application extending this class must provide an implementation for this method that returns new user credentials try try when accessing SMB resources described by thegetRequestingURLandgetRequestingExceptionmethods.protected final SmbAuthExceptionGets the authentication exception that triggered this request.protected final StringGets the URL that is requesting authentication.static NtlmPasswordAuthenticationUsed internally by jCIFS when anSmbAuthExceptionis trapped to retrieve new user credentials.static voidSet the defaultNtlmAuthenticator.
-
Constructor Details
-
NtlmAuthenticator
protected NtlmAuthenticator()Default constructor.
-
-
Method Details
-
setDefault
Set the defaultNtlmAuthenticator. Once the default authenticator is set it cannot be changed. Calling this metho again will have no effect.- Parameters:
a- the authenticator to set as default
-
getRequestingURL
Gets the URL that is requesting authentication.- Returns:
- the URL requiring authentication
-
getRequestingException
Gets the authentication exception that triggered this request.- Returns:
- the authentication exception
-
requestNtlmPasswordAuthentication
public static NtlmPasswordAuthentication requestNtlmPasswordAuthentication(String url, SmbAuthException sae) Used internally by jCIFS when anSmbAuthExceptionis trapped to retrieve new user credentials.- Parameters:
url- the URL that requires authenticationsae- the authentication exception that was thrown- Returns:
- credentials returned by prompt or null if none available
-
getNtlmPasswordAuthentication
An application extending this class must provide an implementation for this method that returns new user credentials try try when accessing SMB resources described by thegetRequestingURLandgetRequestingExceptionmethods. If this method returnsnulltheSmbAuthExceptionthat triggered the authenticator check will simply be rethrown. The default implementation returnsnull.- Returns:
- the authentication credentials or null if none available
-