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

[Feature Request] Add Support for SecurityStamp-like Functionality in GoTrue #378

Open
miyaji255 opened this issue Jan 21, 2025 · 0 comments

Comments

@miyaji255
Copy link

I would like to propose the addition of a feature in GoTrue similar to the SecurityStamp functionality available in ASP.NET Core Identity.

Background:

In ASP.NET Core Identity, the SecurityStamp is used to invalidate all active authentication sessions for a user. This is achieved by updating the SecurityStamp whenever a significant change occurs to the user's account, such as a password reset or a role update. When the SecurityStamp is updated, all active tokens associated with the user become invalid, ensuring that any unauthorized sessions are terminated.

Currently, GoTrue does not provide a built-in mechanism to achieve this behavior. While JWT tokens can be expired based on the exp claim, there is no way to immediately invalidate tokens or force a user to log out across all sessions.

Proposed Feature:

  1. Introduce a SecurityStamp or equivalent identifier stored in the user's metadata or database record.
  2. Update the SecurityStamp whenever critical user information is modified (e.g., password reset, role change).
  3. Extend the token validation process to check the SecurityStamp value, ensuring it matches the value stored on the server.
  4. Provide an API endpoint or admin tool to manually update the SecurityStamp for a user.

Benefits:

  • Enhanced security: Administrators can forcibly log out users across all devices if needed.
  • Better account management: Ensures that account changes (e.g., password resets) take immediate effect on all active sessions.
  • Aligns GoTrue's functionality with other identity management systems.
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

No branches or pull requests

1 participant