I, have created a JWT token with claim as permission Read or Write or Delete as shown in the figure below.
Now, both the Admin/Normal User log on to the system. Admin and normal user get the token and store in the local storage.
For the first time the normal user won't get Read/Write/Create/Delete UI controls. The token expire time is 2 min.
Now the admin change the permission for the normal user in the database as below
.
Since, the token is not expire for the normal user. Still he can't read and write. The logic works if token expire then user login again then he can view the read/write UI control
How can I, achieve this simultaneously with permission changes by admin.
Some of the reference link https://jonhilton.net/identify-users-permissions-with-jwts-and-asp-net-core-webapi/
https://www.jerriepelser.com/blog/using-roles-with-the-jwt-middleware/