public class OAuthSessionAuthorizer
extends java.lang.Object
implements kafka.security.auth.Authorizer
This authorizer does not detect if the token was invalidated mid-session by explicitly revoking it at the authorization server or by revoking the JWKS signing keys at the authorization server.
To install this authorizer in Kafka broker, specify the following in your 'server.properties':
authorizer.class.name=io.strimzi.kafka.oauth.server.OAuthSessionAuthorizer
principal.builder.class=io.strimzi.kafka.oauth.server.OAuthKafkaPrincipalBuilder
When you would otherwise configure another authorizer, you'll need to specify that other authorizer as the delegate
authorizer using the strimzi.authorizer.delegate.class.name configuration property.
For example:
strimzi.authorizer.delegate.class.name=kafka.security.auth.SimpleAclAuthorizer
The specified delegate authorizer should be configured according to its documentation, as if it was installed as the
main authorizer (using authorizer.class.name).
If the `strimzi.authorizer.delegate.class.name` is not set, then you need to explicitly specify that all authorizations should be granted, as long as the access token has not expired by specifying:
strimzi.authorizer.grant.when.no.delegate=true
With this setting the OAuthSessionAuthorizer behaves as if there was no authorizer installed - it grants everything with
the exception that the sessions using SASL/OAUTHBEARER with expired token will be denied.
This authorizer doesn't take super.users setting into account. When used without a delegate every user effectively becomes a super user.
| Constructor and Description |
|---|
OAuthSessionAuthorizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAcls(scala.collection.immutable.Set<kafka.security.auth.Acl> acls,
kafka.security.auth.Resource resource) |
boolean |
authorize(kafka.network.RequestChannel.Session session,
kafka.security.auth.Operation operation,
kafka.security.auth.Resource resource) |
void |
close() |
void |
configure(java.util.Map<java.lang.String,?> configs) |
scala.collection.immutable.Map<kafka.security.auth.Resource,scala.collection.immutable.Set<kafka.security.auth.Acl>> |
getAcls() |
scala.collection.immutable.Map<kafka.security.auth.Resource,scala.collection.immutable.Set<kafka.security.auth.Acl>> |
getAcls(org.apache.kafka.common.security.auth.KafkaPrincipal principal) |
scala.collection.immutable.Set<kafka.security.auth.Acl> |
getAcls(kafka.security.auth.Resource resource) |
boolean |
removeAcls(kafka.security.auth.Resource resource) |
boolean |
removeAcls(scala.collection.immutable.Set<kafka.security.auth.Acl> acls,
kafka.security.auth.Resource resource) |
public void configure(java.util.Map<java.lang.String,?> configs)
configure in interface org.apache.kafka.common.Configurablepublic boolean authorize(kafka.network.RequestChannel.Session session,
kafka.security.auth.Operation operation,
kafka.security.auth.Resource resource)
authorize in interface kafka.security.auth.Authorizerpublic void addAcls(scala.collection.immutable.Set<kafka.security.auth.Acl> acls,
kafka.security.auth.Resource resource)
addAcls in interface kafka.security.auth.Authorizerpublic boolean removeAcls(scala.collection.immutable.Set<kafka.security.auth.Acl> acls,
kafka.security.auth.Resource resource)
removeAcls in interface kafka.security.auth.Authorizerpublic boolean removeAcls(kafka.security.auth.Resource resource)
removeAcls in interface kafka.security.auth.Authorizerpublic scala.collection.immutable.Set<kafka.security.auth.Acl> getAcls(kafka.security.auth.Resource resource)
getAcls in interface kafka.security.auth.Authorizerpublic scala.collection.immutable.Map<kafka.security.auth.Resource,scala.collection.immutable.Set<kafka.security.auth.Acl>> getAcls(org.apache.kafka.common.security.auth.KafkaPrincipal principal)
getAcls in interface kafka.security.auth.Authorizerpublic scala.collection.immutable.Map<kafka.security.auth.Resource,scala.collection.immutable.Set<kafka.security.auth.Acl>> getAcls()
getAcls in interface kafka.security.auth.Authorizerpublic void close()
close in interface kafka.security.auth.AuthorizerCopyright © 2021. All rights reserved.