Class IAMSaslClient
java.lang.Object
software.amazon.msk.auth.iam.internals.IAMSaslClient
- All Implemented Interfaces:
SaslClient
The IAMSaslClient is used to provide SASL integration with AWS IAM.
It has an initial response, so it starts out in the state SEND_CLIENT_FIRST_MESSAGE.
The initial response sent to the server contains an authentication payload.
The authentication payload consists of a json object that includes a signature signed by the client's credentials.
The exact details of the authentication payload can be seen in
AWS4SignedPayloadGenerator.
The credentials used to sign the payload are fetched by invoking the
IAMClientCallbackHandler.
After sending the authentication payload, the client transitions to state RECEIVE_SENDER_RESPONSE.
Once it receives a successful response from the server, the client transitions to the state completed.
A failure at any intermediate step transitions the client to a FAILED state.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionIAMSaslClient(@NonNull String mechanism, @NonNull CallbackHandler cbh, @NonNull String serverName, @NonNull software.amazon.msk.auth.iam.internals.SignedPayloadGenerator payloadGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()byte[]evaluateChallenge(byte[] challenge) static StringgetMechanismNameForClassLoader(ClassLoader classLoader) getNegotiatedProperty(String propName) booleanbooleanbyte[]unwrap(byte[] incoming, int offset, int len) byte[]wrap(byte[] outgoing, int offset, int len)
-
Constructor Details
-
IAMSaslClient
public IAMSaslClient(@NonNull @NonNull String mechanism, @NonNull @NonNull CallbackHandler cbh, @NonNull @NonNull String serverName, @NonNull @NonNull software.amazon.msk.auth.iam.internals.SignedPayloadGenerator payloadGenerator)
-
-
Method Details
-
getMechanismName
- Specified by:
getMechanismNamein interfaceSaslClient
-
hasInitialResponse
public boolean hasInitialResponse()- Specified by:
hasInitialResponsein interfaceSaslClient
-
evaluateChallenge
- Specified by:
evaluateChallengein interfaceSaslClient- Throws:
SaslException
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfaceSaslClient
-
unwrap
- Specified by:
unwrapin interfaceSaslClient- Throws:
SaslException
-
wrap
- Specified by:
wrapin interfaceSaslClient- Throws:
SaslException
-
getNegotiatedProperty
- Specified by:
getNegotiatedPropertyin interfaceSaslClient
-
dispose
- Specified by:
disposein interfaceSaslClient- Throws:
SaslException
-
getResponseRequestId
-
getMechanismNameForClassLoader
-