Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for setting SASL extensions or Principal with OAuthBearer tokens #1394

Closed
Manicben opened this issue Jul 19, 2022 · 1 comment · Fixed by #1402
Closed

No support for setting SASL extensions or Principal with OAuthBearer tokens #1394

Manicben opened this issue Jul 19, 2022 · 1 comment · Fixed by #1402

Comments

@Manicben
Copy link
Contributor

Manicben commented Jul 19, 2022

Description

librdkafka provides support for setting SASL extensions when setting a OAuthBearer token via rd_kafka_oauthbearer_set_token(). This is used in confluent-kafka-go here, but not in confluent-kafka-python, as seen here.

In addition, the principal name also cannot be passed through to rd_kafka_oauthbearer_set_token() in confluent-kafka-python.

Having feature parity between Go and Python would be desirable for us, as we look to support custom OAuth/OIDC callbacks for our customers to integrate their authorization servers with. Unfortunately the built-in KIP-768 OIDC callback only allows for Client ID+Secret authentication, whereas we also wish to support signed JWT client assertions as per RFC-7523, hence the need to continue using custom callbacks.

Proposal

It would be possible to add the principal and extensions as additional return values to the user-provided callback to oauth_cb, and the library handling both the old (token_str, expiry_time) and new (token_str, expiry_time, principal_str, extensions_dict), ensuring to convert the dict into a C char pointer array before passing to rd_kafka_oauthbearer_set_token.

A class, similar to OAuthBearerToken from confluent-kafka-go, would be a more future-proof way to return the values from the callback, but this won't be backwards compatible without some added complexity, which may be acceptable.

We are happy to raise a PR for this, but we'd like to understand what method would be preferable, adding more (optional) return values to the callback function, or using a class object as the return value whilst supporting the old return value for backwards compatibility.

@mhowlett
Copy link
Contributor

the referenced PR is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants