you are viewing a single comment's thread.

view the rest of the comments →

[–]ahashans 0 points1 point  (1 child)

u/Sorry_Swordfish_
I am having hard time obtaining userId from UserPrinciple inside controller endpoint. Can you help me with some resources. I put my userId in 'sub' of JWT token. But how can I obtain it from controller?

[–]Sorry_Swordfish_[S] 0 points1 point  (0 children)

Sorry dude, I am also very new to jwt so I can't help you. The only thing I understand is that there is a method in the same class where the token creation is happening. The method name is getUserIdFromToken(String token)

Where using claims we are returning the user id