Skip to main content

OpenID Connect Authentication

Overview

The application relies on OpenID Connect (OIDC) for user identification and initial authentication. This layer handles the "Who are you?" question before the Bindle layer handles "What can you do?".

Required Scopes

To function correctly, the OIDC Provider must support and grant the following scopes upon authorization:

  • openid: Standard OIDC requirement.
  • profile: To obtain the user's name and nickname.
  • email: To link the user to their internal profile.

Authentication Flow

The following diagram details the interaction between the Client, the People Portal Server, and the OIDC Provider.

Integration Interfaces

The OIDC integration acts as the primary gatekeeper for the application.

Login (/api/auth/login)

Initiates the PKCE-enhanced Authorization Code flow. It computes the necessary nonces, state, and code challenges before redirecting the user to the configured PEOPLEPORTAL_OIDC_DSCVURL.

Callback (/api/auth/redirect)

Handles the return trip from the provider.

  • Verifies State: Ensures the response matches the initiated request.
  • Code Exchange: Swaps the authorization code for an access_token and id_token.
  • Session Inflation: Creates an express-session containing the AuthorizedUser object and the raw accessToken for downstream API calls.

Logout (/api/auth/logout)

Destroys the local express-session thereby, prevent the user from accessing People Portal resources without renewing the session cookie.

Session Management

The application uses express-session backed by a session store (e.g., Redis or Memory). The presence of req.session.accessToken and req.session.authorizedUser is the canonical check for "Is Authenticated?".

Copyright © 2026 Atheesh Thirumalairajan