Package io.stargate.auth
Class PlainTextTokenSaslNegotiator
- java.lang.Object
-
- io.stargate.auth.PlainTextTokenSaslNegotiator
-
- All Implemented Interfaces:
Authenticator.SaslNegotiator
public abstract class PlainTextTokenSaslNegotiator extends Object implements Authenticator.SaslNegotiator
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthenticationServiceauthenticationprotected AuthenticationSubjectauthenticationSubjectprotected inttokenMaxLengthprotected StringtokenUsername
-
Constructor Summary
Constructors Constructor Description PlainTextTokenSaslNegotiator(AuthenticationService authentication, Authenticator.SaslNegotiator wrapped, String tokenUsername, int tokenMaxLength)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanattemptTokenAuthentication(byte[] clientResponse)static CredentialsdecodeCredentials(byte[] bytes)Copy of the private method: org.apache.cassandra.auth.PasswordAuthenticator.PlainTextSaslAuthenticator#decodeCredentials(byte[]).byte[]evaluateResponse(byte[] clientResponse)AuthenticatedUsergetAuthenticatedUser()booleanisComplete()
-
-
-
Field Detail
-
authentication
protected final AuthenticationService authentication
-
authenticationSubject
protected AuthenticationSubject authenticationSubject
-
tokenUsername
protected final String tokenUsername
-
tokenMaxLength
protected final int tokenMaxLength
-
-
Constructor Detail
-
PlainTextTokenSaslNegotiator
public PlainTextTokenSaslNegotiator(AuthenticationService authentication, Authenticator.SaslNegotiator wrapped, String tokenUsername, int tokenMaxLength)
-
-
Method Detail
-
evaluateResponse
public byte[] evaluateResponse(byte[] clientResponse) throws AuthenticationException- Specified by:
evaluateResponsein interfaceAuthenticator.SaslNegotiator- Throws:
AuthenticationException
-
isComplete
public boolean isComplete()
- Specified by:
isCompletein interfaceAuthenticator.SaslNegotiator
-
getAuthenticatedUser
public AuthenticatedUser getAuthenticatedUser() throws AuthenticationException
- Specified by:
getAuthenticatedUserin interfaceAuthenticator.SaslNegotiator- Throws:
AuthenticationException
-
attemptTokenAuthentication
public abstract boolean attemptTokenAuthentication(byte[] clientResponse)
-
decodeCredentials
public static Credentials decodeCredentials(byte[] bytes) throws AuthenticationException
Copy of the private method: org.apache.cassandra.auth.PasswordAuthenticator.PlainTextSaslAuthenticator#decodeCredentials(byte[]).- Parameters:
bytes- encoded credentials string sent by the client- Returns:
- a pair contain the username and password
- Throws:
AuthenticationException- if either the authnId or password is null
-
-