DataProtection - Share Key Material to Sign JWT? #28263
Unanswered
brunobritodev
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
At ASP.NET MVC after a successful login, ASP.NET generate a Cookie, encrypt it and send to user. Great. The dev doesn't really knows how it was generated. I could say that there are many devs maybe doesn't know it is encrypted. Or worst, why we use it. Anyway.
But it's really common nowadays the dev's create REST API's. And they need to emit a JWT Token instead. While the first case they don't need to care about how it works under the hood. But with JWT, they need to digitally sign it. Create a key. Store and manage it.
Definetely isn't a simple Task. HMAC keys need to have a 64 bit key. Rotate every 90 days and so on.
I'll not mention that I've never seen someone using RSA / ECDsa. It's a dream.
When we look at DataProtection component, it accomplish the task in a very competent way. Rotate the key every 90 days. There is an good fit with azure App Service. Many extensions to store it in a safe place.
So I've two questions:
I'm achieved it, but was really painful to find out every piece of code. Debbuging the aspnet code to understande how it works.
sorry about create this issue. But I've tried to search in many places and I couldn't find anywhere.
Beta Was this translation helpful? Give feedback.
All reactions