dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.58k stars 25.29k forks source link

Explain where the JWT secret is stored when using default settings #29584

Open Danghor opened 1 year ago

Danghor commented 1 year ago

The documentation uses the default .AddJwtBearer() method without any options. However, the JWTs generated are signed and the signature is validated somehow. Wouldn't this require the public key to be stored somewhere for the API to verify the given signature? Where is it stored?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Ducki commented 1 year ago

Afaik (and after going through its sources), the default .AddJwtBearer doesnt issue the JWTs, it only validates them using a given signing key. Generation of the JWTs is left to another party.