Skip to content

Usage of "sub" in the JWT Token documentation https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt/ #2143

@cmflynn

Description

@cmflynn

From what I've gathered the "sub" or "subject" field in the JWT token(https://tools.ietf.org/html/rfc7519#section-4.1) payload should be locally or globally unique. The documentation uses the username from the form data in the payload.

Is this a good practice? In a few examples I've found others using a unique id instead like 19898981.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions