Protect an ASP.NET Core API with JWT Bearer Tokens

Talk it through out loud with your AI coach.

The problem

  • medium
  • Pro

Your ASP.NET Core API on AWS must accept access tokens issued by an Amazon Cognito user pool, and some endpoints should be open only to admins. Explain how you'd configure authentication and authorisation, and what the API must check on each token.

What a strong answer covers

  • How the API learns to trust tokens from the identity provider.
  • What makes a token valid for this particular API.
  • Keeping identity and permissions as separate steps.
  • Which error the caller gets in each failure case.

Common mistake: Decoding the token and reading its claims without validating the signature, so anyone can forge an admin token.

Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.

Practise it out loud