Package com.hierynomus.smbj.auth
Class SpnegoAuthenticator
- java.lang.Object
-
- com.hierynomus.smbj.auth.SpnegoAuthenticator
-
- All Implemented Interfaces:
Authenticator
public class SpnegoAuthenticator extends java.lang.Object implements Authenticator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpnegoAuthenticator.Factory
-
Field Summary
Fields Modifier and Type Field Description private org.ietf.jgss.GSSContext
gssContext
private GSSContextConfig
gssContextConfig
private static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description SpnegoAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private byte[]
adjustSessionKeyLength(byte[] key)
[MS-SMB2] 3.2.5.3.1 Handling a New Authentication Session.SessionKey MUST be set to the first 16 bytes of the cryptographic key queried from the GSS protocol for this authenticated context.AuthenticateResponse
authenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext)
private AuthenticateResponse
authenticateSession(GSSAuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext)
void
init(SmbConfig config)
boolean
supports(AuthenticationContext context)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
gssContextConfig
private GSSContextConfig gssContextConfig
-
gssContext
private org.ietf.jgss.GSSContext gssContext
-
-
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
-
authenticateSession
private AuthenticateResponse authenticateSession(GSSAuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) throws TransportException
- Throws:
TransportException
-
adjustSessionKeyLength
private byte[] adjustSessionKeyLength(byte[] key)
[MS-SMB2] 3.2.5.3.1 Handling a New Authentication Session.SessionKey MUST be set to the first 16 bytes of the cryptographic key queried from the GSS protocol for this authenticated context. If the cryptographic key is less than 16 bytes, it is right-padded with zero bytes.- Parameters:
key
- session key from the GSS API- Returns:
- key, truncated or padded to 16 bytes
-
init
public void init(SmbConfig config)
- Specified by:
init
in interfaceAuthenticator
-
supports
public boolean supports(AuthenticationContext context)
- Specified by:
supports
in interfaceAuthenticator
-
-