Click here to Skip to main content
15,347,117 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working Web api project.Bearer API token generation working is fine and authetication also working fine.If one user generated Bearer token and expires 90 days .When he generate another token both is working .How we can stop previous token .Have we need to save/update token in database column and check again after autherization.
Is any default method in web api to stop using old API token.

Please Let me know

I am using MVC4 WEB API

What I have tried:

I am trying to solve by saving token in database column and validate.If any other default method let me know.
Posted
Updated 22-Sep-21 2:33am
v2

1 solution

Hi,

I would
- create a token blacklist and check the tokens against it during authentication/authorization process.
- remove the tokens from the blacklist once they expired (using background thread)

Mira
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900