liveBook · Manning

Openid connect

As explained in .NET MAUI in Action

OpenID Connect is an identity layer built on OAuth 2.0 that enables clients to verify user identity and obtain identity claims.

OpenID Connect (OIDC) extends OAuth 2.0 so a .NET MAUI app can authenticate users through a web browser and obtain a token for protected API calls. section 8.1.2

The app sends users to an IdentityServer login page instead of collecting passwords. After login, the identity provider redirects back with a code that the client exchanges for a JSON Web Token. section 8.1.2

A practical MAUI integration uses these pieces:

  • Configure the authority, client ID, scopes, and redirect URI in OidcClientOptions. section 8.1.2
  • Use WebAuthenticator through a browser adapter to display the provider login page and parse its response. section 8.1.2
  • Register the custom redirect scheme on Android, iOS, macOS, and Windows so the operating system returns the response to the app. section 8.1.2
Figure 8.3 Step 1: Call the LoginAsync method of the OidcClient package. Step 2: The OidcClient package will call WebAuthenticator and display the login page on IdentityServer. Step 3: The user will log in to IdentityServer. Step 4: IdentityServer returns the result via WebAuthenticator. Step 5: The parsed result is returned to OidcClient. Step 6: OidcClient extracts the JWT from the result and returns it to the caller of the LoginAsync method.

Trace the six-step login path from LoginAsync through WebAuthenticator and IdentityServer to the returned JWT. section 8.1.2

How .NET MAUI in Action covers it

How deep it goes
Explains browser login, redirect handling, token exchange, and platform registration, but not identity theory in depth.
Examples
Uses a MAUI stock-taking app, IdentityServer, OidcClient, custom redirect schemes, and platform manifest configurations.
What it assumes
Assumes basic familiarity with identity, authentication, authorization, OAuth 2.0, and .NET MAUI application development.
What you can do after
Build it from scratch by configuring OidcClient, implementing browser authentication, and registering platform callbacks.
How it connects
Connects OAuth 2.0, IdentityServer, identity providers, JSON Web Tokens, WebAuthenticator, and refresh tokens.

Also explained in

Compare how 13 books explain openid connect →

Related concepts

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