Class SaslAuthenticationContext
java.lang.Object
org.apache.kafka.common.security.auth.SaslAuthenticationContext
- All Implemented Interfaces:
AuthenticationContext
-
Constructor Summary
ConstructorsConstructorDescriptionSaslAuthenticationContext(long sessionId, SaslServer server, SecurityProtocol securityProtocol, InetAddress clientAddress, String listenerName) SaslAuthenticationContext(long sessionId, SaslServer server, SecurityProtocol securityProtocol, InetAddress clientAddress, String listenerName, Optional<SSLSession> sslSession, boolean isMTlsSession, boolean disableSwitchover) SaslAuthenticationContext(SaslServer server, SecurityProtocol securityProtocol, InetAddress clientAddress, String listenerName) Method used for tests. -
Method Summary
Modifier and TypeMethodDescriptionAddress of the authenticated clientbooleanbooleanName of the listener used for the connectionUnderlying security protocol of the authentication session.server()longUnique ID assigned to each connectionReturns SSL session for the connection if security protocol is SASL_SSL.
-
Constructor Details
-
SaslAuthenticationContext
public SaslAuthenticationContext(long sessionId, SaslServer server, SecurityProtocol securityProtocol, InetAddress clientAddress, String listenerName) -
SaslAuthenticationContext
public SaslAuthenticationContext(SaslServer server, SecurityProtocol securityProtocol, InetAddress clientAddress, String listenerName) Method used for tests. Session id is not required to be generated in case of tests. -
SaslAuthenticationContext
public SaslAuthenticationContext(long sessionId, SaslServer server, SecurityProtocol securityProtocol, InetAddress clientAddress, String listenerName, Optional<SSLSession> sslSession, boolean isMTlsSession, boolean disableSwitchover)
-
-
Method Details
-
server
-
sslSession
Returns SSL session for the connection if security protocol is SASL_SSL. If SSL mutual client authentication is enabled for the listener, peer principal can be determined usingSSLSession.getPeerPrincipal(). -
securityProtocol
Description copied from interface:AuthenticationContextUnderlying security protocol of the authentication session.- Specified by:
securityProtocolin interfaceAuthenticationContext
-
clientAddress
Description copied from interface:AuthenticationContextAddress of the authenticated client- Specified by:
clientAddressin interfaceAuthenticationContext
-
listenerName
Description copied from interface:AuthenticationContextName of the listener used for the connection- Specified by:
listenerNamein interfaceAuthenticationContext
-
sessionId
public long sessionId()Description copied from interface:AuthenticationContextUnique ID assigned to each connection- Specified by:
sessionIdin interfaceAuthenticationContext
-
isMTlsSession
public boolean isMTlsSession() -
disableSwitchover
public boolean disableSwitchover()- Specified by:
disableSwitchoverin interfaceAuthenticationContext
-