A JSON Web Token (JWT) is a compact, signed token for conveying claims between parties. In a platform login flow, it can carry a user’s identity and team membership so services receive the authorization data they need after authentication. section 4.3.3 section 7.3.2
Keep the identity provider (IDP) between the user and the source of authorization data, rather than making it the source of truth. Configure its authorization server to retrieve user attributes and include the relevant claims in the login result. Team membership is one possible permission boundary, not the only one. section 4.3.3
Team access from a CLI
A developer starts authentication in a terminal, completes the browser step through GitHub, and grants device authorization. The IDP uses the resulting GitHub access token to request the developer’s organization teams, then creates a verifiable JWT containing an ID token with that team list as a claim. A refresh token can also be included. section 7.3.2
Figure 7.9 In this authentication and authorization flow, the IDP acts just as a secure go-between. The user must authenticate through GitHub and grant their device authorization to receive a JSON Web Token.
Follow the division of work between the CLI, GitHub and the IDP: the IDP acts as a secure go-between before the user receives a JWT. section 7.3.2
For a repeatable implementation, configure the GitHub OAuth application and automate the Auth0 application configuration used by the CLI. Prefer an integrable OpenID Connect approach over tools that require tickets and manual role assignment: the token is useful only if obtaining the right claims remains a workable self-service experience. section 4.3.3 section 7.3.2










