I'm fairly new to ASP.NET Core.
I'm using JWT to authenicate a web api.
In most JWT code on online tutorials, we can find Issuer and Audience property metioned as shown below.
var tokenDescriptor = new SecurityTokenDescriptor
{
Issuer = configuration["Jwt:Issuer"],
Audience = configuration["Jwt:Audience"],
...
}
jwt.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidateAudience = true,
...
};
Can anyone please explain, what is use of both these, is it to validate the JWT Server and JWT Client
And also how to validate these
If you register the following service the authentication middleware will then validate on your behalf.