public interface BearerTokenWithPayload
extends org.apache.kafka.common.security.oauthbearer.OAuthBearerToken
This class is the only notion of client session that we can get. Kafka code holds on to it for as long as the session is alive, and then the object can be garbage collected.
Successful re-authentication starts a new session without disconnecting the current connection, avoiding the need to re-establish any existing TLS connection for example.
Token is instantiated during authentication, but the 'payload' methods can be accessed later by custom extensions. For example, it can be used by a custom authorizer to cache a parsed JWT token payload or to cache authorization grants for current session.
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.node.ObjectNode |
getClaimsJSON()
The token claims as a JSON object.
|
java.util.Set<java.lang.String> |
getGroups()
Get groups associated with this token (principal).
|
com.fasterxml.jackson.databind.JsonNode |
getPayload()
Get the usage dependent object previously associated with this instance by calling
setPayload(com.fasterxml.jackson.databind.JsonNode) |
default int |
getSessionId()
This method returns an id of the current instance of this object.
|
void |
setPayload(com.fasterxml.jackson.databind.JsonNode payload)
Associate a usage dependent object with this instance
|
com.fasterxml.jackson.databind.JsonNode getPayload()
setPayload(com.fasterxml.jackson.databind.JsonNode)void setPayload(com.fasterxml.jackson.databind.JsonNode payload)
payload - The object to associate with this instancejava.util.Set<java.lang.String> getGroups()
com.fasterxml.jackson.databind.node.ObjectNode getClaimsJSON()
default int getSessionId()
Copyright © 2024. All rights reserved.