Skip to content

The JWT Token don't contain the securityId property. #7427

Answered by dougal83
alvis-do asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kudos-cmd

If you take a look at the source you will see the securityId is given to the id property in the generateToken function:

https://github.com/strongloop/loopback-next/blob/70f37d7cfc09db01ed5cf49c3150ce32ec16fcf2/extensions/authentication-jwt/src/services/jwt.service.ts#L54-L77

Try accessing the id property in this case to access the user's Id. You might also expect to see the property named sub to contain the user (subject) id but that is not the case here.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dougal83
Comment options

Answer selected by alvis-do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants