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

Handle SASL/OAUTHBEARER token rejection #1428

Merged
merged 1 commit into from
Jul 17, 2019
Merged

Handle SASL/OAUTHBEARER token rejection #1428

merged 1 commit into from
Jul 17, 2019

Conversation

mk6i
Copy link
Contributor

@mk6i mk6i commented Jul 16, 2019

This PR aims to fix a bug (Issue #1423) in the SASL/OAUTHBEARER implementation where the Sarama client does not fail when the broker rejects the auth token and instead fails on the subsequent request following the auth flow.

This fix is based upon how the Java implementation handles token rejection.

The client handles SaslAuthenticate responses containing a non-empty challenge as an auth failure. Previously, Sarama only logged the challenge. The initial broker response containing the challenge does not contain an error code that can be raised to the client—the client must then make a subsequent request to the broker with a \x01 control character in order to terminate the token exchange and receive the error code from the broker, which is immediately surfaced to the client.

cc @d1egoaz

@mk6i mk6i changed the title [WIP] Issue #1423 - Handle SASL/OAUTHBEARER broker challenge Issue #1423 - Handle SASL/OAUTHBEARER broker challenge Jul 16, 2019
@mk6i mk6i changed the title Issue #1423 - Handle SASL/OAUTHBEARER broker challenge Handle SASL/OAUTHBEARER broker token rejection Jul 16, 2019
@mk6i mk6i changed the title Handle SASL/OAUTHBEARER broker token rejection Handle SASL/OAUTHBEARER token rejection Jul 16, 2019
Copy link
Contributor

@varun06 varun06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bai bai merged commit d194841 into IBM:master Jul 17, 2019
d1egoaz pushed a commit that referenced this pull request Jul 22, 2019
#### Version 1.23.1 (2019-07-22)

Bug Fixes:
- Fix fetch delete bug record
  ([1425](#1425)).
- Handle SASL/OAUTHBEARER token rejection
  ([1428](#1428)).
d1egoaz added a commit that referenced this pull request Jul 22, 2019
#### Version 1.23.1 (2019-07-22)

Bug Fixes:
- Fix fetch delete bug record
  ([1425](#1425)).
- Handle SASL/OAUTHBEARER token rejection
  ([1428](#1428)).
@d1egoaz d1egoaz mentioned this pull request Jul 22, 2019
d1egoaz added a commit that referenced this pull request Jul 22, 2019
#### Version 1.23.1 (2019-07-22)

Bug Fixes:
- Fix fetch delete bug record
  ([1425](#1425)).
- Handle SASL/OAUTHBEARER token rejection
  ([1428](#1428)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants