Package com.hierynomus.smbj.auth
Class NtlmAuthenticator
- java.lang.Object
-
- com.hierynomus.smbj.auth.NtlmAuthenticator
-
- All Implemented Interfaces:
Authenticator
public class NtlmAuthenticator extends java.lang.Object implements Authenticator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNtlmAuthenticator.Factory(package private) static classNtlmAuthenticator.State
-
Field Summary
Fields Modifier and Type Field Description private NtlmConfigconfigprivate NtlmV2Functionsfunctionsprivate static org.slf4j.Loggerloggerprivate java.util.Set<NtlmNegotiateFlag>negotiateFlagsprivate byte[]negotiateMessageprivate static com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifierNTLMSSPprivate java.util.Randomrandomprivate SecurityProvidersecurityProviderprivate NtlmAuthenticator.Statestate
-
Constructor Summary
Constructors Constructor Description NtlmAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticateResponseauthenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext)private TargetInfocreateClientTargetInfo(NtlmChallenge serverNtlmChallenge)private AuthenticateResponsedoAuthenticate(AuthenticationContext context, NtlmChallenge serverNtlmChallenge, byte[] ntlmChallengeBytes)private AuthenticateResponsedoNegotiate(AuthenticationContext context, byte[] gssToken)voidinit(SmbConfig config)private SpnegoTokennegTokenInit(NtlmNegotiate ntlmNegotiate)private SpnegoTokennegTokenTarg(NtlmAuthenticate resp)booleansupports(AuthenticationContext context)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
NTLMSSP
private static final com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier NTLMSSP
-
securityProvider
private SecurityProvider securityProvider
-
random
private java.util.Random random
-
functions
private NtlmV2Functions functions
-
config
private NtlmConfig config
-
state
private NtlmAuthenticator.State state
-
negotiateFlags
private java.util.Set<NtlmNegotiateFlag> negotiateFlags
-
negotiateMessage
private byte[] negotiateMessage
-
-
Method Detail
-
authenticate
public AuthenticateResponse authenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) throws java.io.IOException
- Specified by:
authenticatein interfaceAuthenticator- Throws:
java.io.IOException
-
doNegotiate
private AuthenticateResponse doNegotiate(AuthenticationContext context, byte[] gssToken) throws SpnegoException
- Throws:
SpnegoException
-
doAuthenticate
private AuthenticateResponse doAuthenticate(AuthenticationContext context, NtlmChallenge serverNtlmChallenge, byte[] ntlmChallengeBytes) throws SpnegoException
- Throws:
SpnegoException
-
createClientTargetInfo
private TargetInfo createClientTargetInfo(NtlmChallenge serverNtlmChallenge)
-
negTokenInit
private SpnegoToken negTokenInit(NtlmNegotiate ntlmNegotiate) throws SpnegoException
- Throws:
SpnegoException
-
negTokenTarg
private SpnegoToken negTokenTarg(NtlmAuthenticate resp) throws SpnegoException
- Throws:
SpnegoException
-
init
public void init(SmbConfig config)
- Specified by:
initin interfaceAuthenticator
-
supports
public boolean supports(AuthenticationContext context)
- Specified by:
supportsin interfaceAuthenticator
-
-