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: always rotate refresh tokens for public clients #2846

Merged

Conversation

mikeroda
Copy link
Contributor

When refreshing a token, always rotate for public clients, thus not requiring rotation to be enabled for all clients and preventing the possible error condition for public clients.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/187475484

The labels on this github issue will be updated when the story is started.

@strehle strehle added the clarification needed The issue is not accepted but we need clarification label Apr 24, 2024
@strehle
Copy link
Member

strehle commented Apr 24, 2024

@mikeroda this PR has conflicts from the begin, so you need to resolve conflicts / rebase your branch

When refreshing a token, always rotate for public clients, thus
not requiring rotation to be enabled for all clients and
preventing the possible error condition for public clients.

Change-Id: I6ab80dd8b1928ab55863cea52849ff22f35c2779
@mikeroda mikeroda force-pushed the allowpublic-implicit-rotation branch from fec7d75 to cefc301 Compare April 25, 2024 13:10
@strehle strehle removed the clarification needed The issue is not accepted but we need clarification label Apr 26, 2024
@strehle
Copy link
Member

strehle commented Apr 26, 2024

@mikeroda will check the PR and we take it on the list , means if we do not see a problem it should come into dev , end of next week

@strehle strehle self-assigned this Apr 26, 2024
@strehle strehle requested a review from a team April 26, 2024 16:13
@strehle
Copy link
Member

strehle commented May 1, 2024

Copy link
Member

@strehle strehle left a comment

Choose a reason for hiding this comment

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

Ok from my side @swalchemist can you check from broadcom side.
Only touches your clients if they use public clients...

@strehle strehle merged commit bef96ed into cloudfoundry:develop May 13, 2024
20 checks passed
@peterhaochen47
Copy link
Member

Hi we have not looked at this PR yet.

@strehle
Copy link
Member

strehle commented May 13, 2024

Hi we have not looked at this PR yet.

Hi we have not looked at this PR yet.

Ok can you please look and vote if it needs to be reverted

@peterhaochen47
Copy link
Member

peterhaochen47 commented May 14, 2024

We do have a public client. This change seems like a breaking change?

  1. Previously, whether the refresh token is rotated is controlled by the uaa.jwt.refresh.rotate flag and defaulted to false to maintained backward compatibility. Correct?

This current change makes an exception to the flag and always rotate public clients's refresh token, and potentially breaking the backward compatibility brought by the flag.

  1. Separately, this might also be confusing to the users when they set the uaa.jwt.refresh.rotate flag to false but still see their refresh tokens being rotated?

thus not requiring rotation to be enabled for all clients and preventing the possible error condition for public clients

Could you explain this? If you wish to rotate the refresh tokens, why not just set uaa.jwt.refresh.rotate: true to enable that for all clients? What "possible error condition" would that create for public clients?

@mikeroda
Copy link
Contributor Author

Ultimately we want to get to always rotating refresh tokens for public clients. The problem with the flag is it affects all clients. This doesn't seem like an adverse change because if you didn't set the flag and attempted to refresh a token with a public client, you would get "Refresh without client authentication not allowed" error. Now you would get a successful response and newly rotated refresh token. So I don't see how this breaks anything.

@peterhaochen47
Copy link
Member

peterhaochen47 commented May 14, 2024

if you didn't set the flag and attempted to refresh a token with a public client, you would get "Refresh without client authentication not allowed" error

I see. Currently, UAA doesn't allow token refresh for public clients when uaa.jwt.refresh.rotate: false? (is this documented somewhere?). Then yes, this is a non-breaking change.

@peterhaochen47 peterhaochen47 self-requested a review May 15, 2024 17:27
hsinn0 pushed a commit that referenced this pull request May 17, 2024
When refreshing a token, always rotate for public clients, thus
not requiring rotation to be enabled for all clients and
preventing the possible error condition for public clients.

Change-Id: I6ab80dd8b1928ab55863cea52849ff22f35c2779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants