Nitin Rastogi
Nitin Rastogi

Reputation: 1456

JWTBearer Token Validation in Azure Apps

I am using a JWTBearer Token for authentication of my API App in Azure. My API App is using the following middleware - Microsoft.AspNetCore.Authentication.JwtBearer (1.1.2).

I have a token provided by other apps to the API App. Question I have is - Does this middleware perform the validation of token or would I have to do it manually?

Upvotes: 1

Views: 190

Answers (1)

juunas
juunas

Reputation: 58723

The library does validation. Check here for example: https://github.com/aspnet/Security/blob/rel/1.1.2/src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerHandler.cs#L100.

It will check at least that the issuer is correct and that the signature has been made with one of the signing keys it is aware of.

If it considers the token valid, it will create a user principal with the claims found in the token.

Upvotes: 2

Related Questions