I would like to forcibly invalidate a Bearer Token that was issued by the default ApplicationOAuthProvider from the ASP.Net Web API2 project template.
The project has the below code, which doesn't work for Bearer tokens.
Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType);
There's nothing built in for that - you could build your own mechanism for it which typically involves something like a database check on each request.
The other thing is, keep token lifetime short and use something like refresh tokens - see here: http://leastprivilege.com/2013/11/15/adding-refresh-tokens-to-a-web-api-v2-authorization-server/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With