liveBook · Manning

Single sign-on

As explained in Building Distributed Applications that Work

Single sign-on is an authentication mechanism that lets a user access multiple applications after authenticating once.

Single sign-on (SSO) lets a user access multiple applications after authenticating once. A shared identity provider (IdP) manages the login and lets protected applications verify that the user is authenticated. For example, a user signed in to a Google account can use Sign in with Google on participating websites. section 8.1

A typical sign-in flow works like this:

  • A user requests a protected page. Finding no login information, the application redirects the user to the IdP’s login page. section 8.1
  • After the user authenticates, the IdP redirects them back. A token sent with the redirect confirms authentication and can be kept in temporary storage, such as a browser cookie. section 8.1
  • The token can authenticate the user with other applications protected by the same IdP. It eventually expires, though continued use can refresh it. section 8.1

Authentication establishes who a user is; authorization determines whether they may access a resource. OpenID Connect (OIDC) is commonly used for authentication, while OAuth can provide authorization alongside it. In an Aspire-hosted application, an internally hosted IdP can be reached through service discovery, and an authenticated UI can pass credentials and permission information to a backend API via a JWT. section 8.1 section 8.6

Figure 8.1 SSO flow
figure

Follow the redirect from a protected application to the IdP and back to see where the shared sign-in takes effect. section 8.1

How Building Distributed Applications that Work covers it

How deep it goes
Walks through redirects, token storage, reuse, and expiry at a simplified flow level rather than protocol internals.
Examples
Illustrates shared login with a Google account and a protected-page redirect flow.
What it assumes
Introduces the redirect-and-token process from a simplified starting point without requiring protocol internals.
What you can do after
Evaluate/understand how one IdP login grants access across protected applications and when a user must authenticate again.
How it connects
Connects SSO to identity providers, authentication, authorization, OpenID Connect, OAuth, and JWTs.

Also explained in

Compare how 3 books explain single sign-on →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Distributed Applications that Work. The section links point to the parts of the book it draws on.