joydipkanjilal / jwt-aspnetcore

Implementing JWT Authentication in ASP.NET Core 5
44 stars 32 forks source link

Refresh tokens #1

Open OzBob opened 3 years ago

OzBob commented 3 years ago

Thanks for an interesting article https://www.codemag.com/Article/2105051/Implementing-JWT-Authentication-in-ASP.NET-Core-5

I have also enjoyed a similar post by Rick Strahl on JWTs here

Do you have a thought on how to implement Refresh tokens? I don't think I can ask the user to re-authenticate every time their JWT?

AspIdentity has a AspNetUserTokens table, but it is only accessible to registered Providers e.g. TokenOptions.DefaultAuthenticatorProvider I have a little solution in mind re-using the default provider, but that would only work if only one client type ever connected to my API. I've had no luck registering my own Provider, so far.

joydipkanjilal commented 3 years ago

I'll write one on refresh tokens soon. Stay tuned!