liveBook · Manning

Identity provider

As explained in .NET in Action, Second Edition

An identity provider is a service that authenticates users and supplies identity and authorization metadata to client applications.

An identity provider authenticates users and supplies identity and authorization metadata to client applications. OpenID Connect lets an API delegate account management to an external provider, then verify the token presented with each request. Tokens usually use JSON Web Token (JWT) format, so the API avoids storing another username-and-password database and associated personal data. section 9.5

A production integration typically follows these steps:

  • Register the API or client with an identity provider and configure its client ID, tenant, scopes, and endpoints. section 9.5.2
  • Add Microsoft.AspNetCore.Authentication.JwtBearer, select the JWT bearer scheme, and enable authentication before authorization in the request pipeline. section 9.5
  • Protect API endpoints with authorization, then validate bearer tokens rather than trusting identity claims supplied by the caller. section 9.7
  • Configure Swagger UI with OAuth settings so it can authenticate a user, obtain a token, and send it to the API. section 9.5.2

ASP.NET Core API with JWT authentication

Register JwtBearer authentication, call UseAuthentication and UseAuthorization, and apply [Authorize] to CatalogController. Swagger UI can then authenticate against Azure AD; a successful authorized request returns 200 instead of 401. section 9.5.2

How .NET in Action, Second Edition covers it

How deep it goes
Explains OpenID Connect delegation, JWT verification, discovery documents, and ASP.NET Core configuration, while deferring the specification’s broader history.
Examples
Uses Microsoft, Facebook, X, Auth0, Okta, Azure AD, Swagger UI, JWT bearer configuration, and an authorized CatalogController.
What you can do after
Configure ASP.NET Core JWT bearer authentication, protect controllers, and operate Swagger UI with an external provider.
How it connects
Connects OpenID Connect, authentication, authorization, JWT, OAuth, Swagger UI, discovery documents, scopes, and Azure AD.

Also explained in

Compare how 12 books explain identity provider →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.