dwyl/learn-json-web-tokens

misleading information on jwt fields

Aperta

#94 aperta il 3 gen 2019

 (1 commento) (3 reazioni) (0 assegnatari)JavaScript (267 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (4175 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

sub: subject of the token (rarely used)

Sub should be your userID, and you should use it as such.

those fields are used in openId and it is a good idea to at least mention it and update at least the mandatory fields.

sub REQUIRED. Subject Identifier. A locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client, e.g., 24400320 or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4. It MUST NOT exceed 255 ASCII characters in length. The sub value is a case sensitive string.

your users will change names and such, but the ID will stay constant. This is a very very very important field.

Guida contributor