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

Fix exception when refreshing oauth2 token #1690

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

BreakingBread0
Copy link

@BreakingBread0 BreakingBread0 commented Sep 27, 2024

Proposed Changes

This fixes a small bug that happens when refreshing the OAuth2 access token from the OAuth backchannel provider. The dictionary key "scope" in BuildRefreshParameters is already set in BuildRequestParameters and therefore this throws an exception.

Types of Changes

  • Bug fix (has no issue associated with it)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)

Checklist

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

Before being added to the dictionary, _scope undergoes two different checks: Nullability and string.IsNullOrEmpty in the two aforementioned methods. I do not know if this is intentional or not.

@lukebakken lukebakken self-assigned this Oct 1, 2024
@lukebakken lukebakken added this to the 7.0.0 milestone Oct 1, 2024
@lukebakken lukebakken self-requested a review October 1, 2024 16:07
@lukebakken
Copy link
Contributor

Thank you for this PR @BreakingBread0. Would you mind sharing which version of this library you found this issue in?

@BreakingBread0
Copy link
Author

Thank you for this PR @BreakingBread0. Would you mind sharing which version of this library you found this issue in?

The versions I currently use (and in which I found the bug) are:

  • RabbitMQ.Client 6.8.1 and
  • RabbitMQ.Client.OAuth2 1.0.0
    Both were installed from Nuget.

@lukebakken lukebakken force-pushed the fix-oauth2-refresh-token branch from ec0f472 to 1dab877 Compare October 2, 2024 23:29
Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

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

Thank you @BreakingBread0

@lukebakken lukebakken merged commit 6147962 into rabbitmq:main Oct 3, 2024
11 checks passed
lukebakken added a commit that referenced this pull request Oct 3, 2024
Fix exception when refreshing OAuth2 token
lukebakken added a commit that referenced this pull request Oct 3, 2024
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