Skip to content

Token refresh doesn't re-execute issuer.success() to update dynamic user attributes #275

@Jhinger

Description

@Jhinger

When using the client.refresh() method, the access/refresh tokens are rotated but the content within the token is not refreshed. This prevents dynamic user attributes that are fetched during the initial issuer.success() method from being updated during token refresh operations (without having the user go through the authentication flow again).

Current Behaviour:

  • Initial token generation in issuer.success() dynamically fetches user attributes from Redis
  • Token refresh via refresh() rotates the token but preserves the original claims

Use Case:

  • I'm storing some dynamic user attributes (permissions, roles, profile data) in Redis that can change independently of the authentication session. When tokens are refreshed, I'd like for these updated values to be included in the new access token to maintain accurate auth context.

I've reviewed the client documentation and don't see an existing method/flow to achieve this behaviour. I'm hoping I'm not missing some obvious solution or doing something fundamentally wrong in my approach. Any guidance would be greatly appreciated!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions