JWTRefreshTokenBundle icon indicating copy to clipboard operation
JWTRefreshTokenBundle copied to clipboard

Update new token with previous value of token

Open alexdu98 opened this issue 5 years ago • 1 comments

Hello,

I would like to update the new token with the previous version of the token.

In fact, when I log on my website, the token contains the default year value of the website. The problem is that this value can be changed by user. When it happens, a new token is generated with the new value populated in token, but if the token expires, the token got by refresh token will still be populated with default year value.

So, I would like to get the year selected by the user and stored in the expired token, and set the new token with it. How to do it please ?

I looked in gesdinet.refresh_token event, but I don't feel like the information I need is there. Perhaps by extends attachRefreshToken(AuthenticationSuccessEvent) of AttachRefreshTokenOnSuccessListener class ? But how to call my new class or even access to the expired token value ?

Thank you for your help.

alexdu98 avatar Oct 11 '18 16:10 alexdu98

My Problem might be related to yours. I`ll try to explain it here:

When i login (api/login) into my API i provide a user_identifier, and a workstation_identifier. Both are uuids The JWTToken that i receive has this "workstation_identifier" inside.

When i call the refresh api (/api/token/refresh) with with my RefreshToken. Since the workstation_identifier is only inside of the JWTToken but not inside of the refresh_token, i have an issue. The new JWTToken that i get from this /api/refresh/token API, has no workstation_identifier.

Any Ideas how to solve this problem?

chucky2305 avatar May 06 '19 13:05 chucky2305