Mid ASP.NET Core

Authorization/authentication in APIs (JWT, OAuth)?

  • Use JWT Bearer Tokens for stateless auth:

services.AddAuthentication(JwtBearerDefaults.AuthenticationSch

eme)

.AddJwtBearer(options => { ... });

  • Secure endpoints with:

[Authorize(Roles = "Admin")]

  • OAuth supported via IdentityServer, Azure AD, or external

providers.

More from ASP.NET Core Tutorial

All questions for this course