uaa icon indicating copy to clipboard operation
uaa copied to clipboard

UAADB revocable_tokens table is filled even if uaa.jwt.revocable is set to "false" in the YML file

Open aalbanes opened this issue 9 years ago • 11 comments

My team is running a huge CF deployment and we noticed that event if the we have uaa.jwt.revocable set to false in the bosh YML file the UAADB table revocable_tokens is filled with new records. This was not happening in the previous version we were running (CF 235).

It seems to me that issue is in this class Link which doesn't properly skip token persistence if the uaa.jwt.revocable is false.

This is a problem for us (on DBA side) because revocable_tokens table contains more than 3M records.

aalbanes avatar Jan 04 '17 16:01 aalbanes

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

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

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

cf-gitbot avatar Jan 04 '17 16:01 cf-gitbot

If refresh tokens are requested, they are delivered in a revocable format, always. There was a bug discovered where we only clean the table if the refresh token is being refresh. With https://github.com/cloudfoundry/uaa/commit/51780c3c63fc98636f71d778c4fb8a4218ad3a82#diff-fbe33c1f3c5844b8f9482f55eaa64845 we also clean the table when we store tokens

fhanik avatar Jan 04 '17 18:01 fhanik

@aalbanes see #466 for additional diagnostics

gberche-orange avatar Jan 05 '17 09:01 gberche-orange

@gberche-orange Guillaume thx for reference. @fhanik Filip, as far as I recall in the CF release context, CC are not going to validate if a refresh token expired or not but it it check for expiration field within the JWT itself. It this still the case ? If so.. which is the reason why we cannot enforce a refresh token to not be revocable.

aalbanes avatar Jan 05 '17 14:01 aalbanes

@aalbanes I think you can set the following to true

https://github.com/cloudfoundry/uaa-release/blob/develop/jobs/uaa/spec#L362-L364

I don't think the feature was meant to behave that way, but looking at the code, it will not issue refresh tokens if this value is set to true and the client doesn't have the uaa.offline_token scope.

fhanik avatar Jan 05 '17 14:01 fhanik

@fhanik not having a refresh is not a solution. I think what we really need to fix is that refresh tokens are there, BUT it is configurable whether it is revocable. The current design doesn't really work at scale. FWIW, OpenStack had the same issues some years ago b/c they were storing too many tokens and then faced issues at scale. @sreetummidi let me know if this change will be possible or if you want to discuss this further on a PM level

smoser-ibm avatar Jan 09 '17 14:01 smoser-ibm

@fhanik @sreetummidi can you comment please ?

smoser-ibm avatar Jan 13 '17 14:01 smoser-ibm

@smoser-ibm Correct, didn't suggest it as a solution, but a work around, until a solution is in place :)

This issue will be open until a solution is in place.

fhanik avatar Jan 13 '17 15:01 fhanik

@smoser-ibm We will resurrect this feature for UAA 4.0 https://www.pivotaltracker.com/story/show/138155269

sreetummidi avatar Jan 23 '17 16:01 sreetummidi

@sreetummidi - why is the Issue closed now? Has this actually been resolved? Neither of the related tracker items:

https://www.pivotaltracker.com/n/projects/997278/stories/137028417 https://www.pivotaltracker.com/n/projects/997278/stories/138155269

appear to have been started, so confused why this Issue was closed?

ScarletTanager avatar Feb 02 '17 15:02 ScarletTanager

@ScarletTanager Yes, issue has been resolved. And released. https://github.com/cloudfoundry/uaa-release/releases/tag/v27

fhanik avatar Feb 28 '17 02:02 fhanik