ITADN

Can I issue my own JWT token when signing in user?

#160ClosedEspleth 创建于 2023-10-07
question
E
Esplethcommented
I want to implement sign-in with Steam, but I want to actually register users, add user entity to my DB, and issue my own JWT token with my own payload: e.g. my custom user id for different internal purposes. And as I can see from demo project, if I add /signin-steam enpoint, it's not even executed. I'm still relying on ASP.NET Core's built-in JWT validation, but I don't want to have a zoo of different auth tokens, since Steam will be far from only one external sign-in service. Also, my backend is just bare REST API (frontend is completely independent and written by another person, which complicates things a bit). Because of this, and my not the best understanding of auth schemes, I'm struggling to understand if I can use this library in my context, or maybe I'm doing something completely wrong. So the desired solution for me would be: Frontend handles Steam auth, gets all necessary auth info from Steam (query and cookie as I understand it), and passes all this info to my backend sign-in-steam endpoint, where I validate all this, register/authorize user, and issue my own JWT token, which is returned back to the frontend. We did a similar thing with Google sign-in (frontend passes me Google's JWT token, which I validate and extract user info from), but I can't find a way to do this for Steam.
关闭于 2023-10-08 1 条评论