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 class
NtlmAuthenticator.Factory
(package private) static class
NtlmAuthenticator.State
-
Field Summary
Fields Modifier and Type Field Description private NtlmConfig
config
private NtlmV2Functions
functions
private static org.slf4j.Logger
logger
private java.util.Set<NtlmNegotiateFlag>
negotiateFlags
private byte[]
negotiateMessage
private static com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier
NTLMSSP
private java.util.Random
random
private SecurityProvider
securityProvider
private NtlmAuthenticator.State
state
-
Constructor Summary
Constructors Constructor Description NtlmAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticateResponse
authenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext)
private TargetInfo
createClientTargetInfo(NtlmChallenge serverNtlmChallenge)
private AuthenticateResponse
doAuthenticate(AuthenticationContext context, NtlmChallenge serverNtlmChallenge, byte[] ntlmChallengeBytes)
private AuthenticateResponse
doNegotiate(AuthenticationContext context, byte[] gssToken)
void
init(SmbConfig config)
private SpnegoToken
negTokenInit(NtlmNegotiate ntlmNegotiate)
private SpnegoToken
negTokenTarg(NtlmAuthenticate resp)
boolean
supports(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:
authenticate
in 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:
init
in interfaceAuthenticator
-
supports
public boolean supports(AuthenticationContext context)
- Specified by:
supports
in interfaceAuthenticator
-
-