WebSSO / Entra ID
Northwestern users authenticate via single sign-on. The starter supports two SSO providers through the northwestern-sysdev/laravel-soa package’s WebSSOAuthentication trait.
Providers:
- Microsoft Entra ID (formerly Azure AD) - OAuth2 authorization code flow directly to Microsoft
- Online Passport (agentless WebSSO) - Cookie-based SSO via OpenAM/ForgeRock, validated through Apigee
The starter auto-detects which provider to use based on your credentials. If WEBSSO_API_KEY is set or WEBSSO_STRATEGY is forgerock-direct, login/logout routes through Online Passport. Otherwise, it defaults to Entra ID. Only one provider is active at a time.
For a higher-level overview of all authentication methods, see the Authentication documentation.
How It Works (Entra ID)
Section titled “How It Works (Entra ID)”-
User clicks “Sign in with NetID”
The application redirects to Microsoft’s login endpoint via
WebSSOController@oauthRedirect. The OAuth2 authorization code flow goes directly tologin.microsoftonline.com, not through Apigee or ForgeRock. -
User authenticates with Microsoft
User enters their credentials.
-
Callback with token
Microsoft redirects back to
/auth/azure-ad/callbackvia POST with an authorization code. CSRF middleware is excluded for this route since the request originates from the identity provider. Thelaravel-soapackage exchanges the code for tokens and validates the ID token JWT using Microsoft’s signing keys. -
Directory Search lookup
WebSSOController::findUserByNetID()callsFindOrUpdateUserFromDirectoryto provision or update the user from Northwestern’s directory. This includes a 3-attempt retry with 500ms delays. If all retries fail, a 503 error page is rendered. -
Session established
The
authenticated()hook regenerates the session and CSRF token, creates aUserLoginRecordfor audit purposes, and logs the user in.
How It Works (Online Passport)
Section titled “How It Works (Online Passport)”-
User clicks “Sign in with NetID”
The application redirects to ForgeRock’s login page via
WebSSOController@login. The user is sent to Northwestern’s Online Passport login portal. -
User authenticates with ForgeRock
User enters their NetID credentials (and completes MFA if Duo is enabled).
-
Cookie validation
After authentication, ForgeRock sets a
nussosession cookie. Thelaravel-soapackage validates this cookie by calling Northwestern’s agentless WebSSO API (via Apigee or directly against ForgeRock, depending on the configured strategy). -
Directory Search lookup
WebSSOController::findUserByNetID()callsFindOrUpdateUserFromDirectoryto provision or update the user, identical to the Entra ID flow. -
Session established
The
authenticated()hook regenerates the session and CSRF token, creates aUserLoginRecordfor audit purposes, and logs the user in.
Routes
Section titled “Routes”Entra ID Routes
Section titled “Entra ID Routes”| Method | URI | Controller | Name |
|---|---|---|---|
GET | /auth/azure-ad/redirect | WebSSOController@oauthRedirect | login-oauth-redirect |
POST | /auth/azure-ad/callback | WebSSOController@oauthCallback | login-oauth-callback |
GET | /auth/azure-ad/oauth-logout | WebSSOController@oauthLogout | login-oauth-logout |
Online Passport Routes
Section titled “Online Passport Routes”| Method | URI | Controller | Name |
|---|---|---|---|
GET | /auth/websso/login | WebSSOController@login | login-websso |
GET | /auth/websso/logout | WebSSOController@logout | login-websso-logout |
Logout
Section titled “Logout”Entra ID Logout
Section titled “Entra ID Logout”The oauthLogout() method handles SSO session cleanup:
- Production - Delegates to the
laravel-soatrait’soauthLogout()method, redirecting to Entra ID’s logout endpoint. The local session is cleared afterward. - CI environment - Skips the Entra redirect and performs a local-only logout to avoid external service dependencies.
Online Passport Logout
Section titled “Online Passport Logout”The logout() method (from the WebSSOAuthentication trait) redirects the user to ForgeRock’s logout endpoint to clear the nusso session cookie. The local session is invalidated before the redirect.
Error Handling
Section titled “Error Handling”If the Directory Search lookup fails after 3 retries during the SSO callback, the controller throws a ServiceDownError identifying the DIRECTORY_SEARCH service. The application’s exception handler renders a user-facing 503 page rather than exposing a stack trace.
Entra ID Configuration
Section titled “Entra ID Configuration”Online Passport Configuration
Section titled “Online Passport Configuration”Setting WEBSSO_API_KEY (or using WEBSSO_STRATEGY=forgerock-direct) switches the starter from Entra ID to Online Passport. The login and logout buttons will automatically route through ForgeRock instead of Microsoft.
WEBSSO_STRATEGY apigee SSO strategy (apigee or forgerock-direct)
WEBSSO_URL_BASE https://uat-nusso.it.northwestern.edu ForgeRock base URL
WEBSSO_API_URL_BASE https://northwestern-prod.apigee.net/agentless-websso Agentless WebSSO API URL (Apigee)
WEBSSO_API_KEY Required Apigee API key for agentless WebSSO
WEBSSO_REALM northwestern WebSSO realm
WEBSSO_COOKIE_NAME nusso WebSSO session cookie name
DUO_ENABLED false Enable Duo MFA (sets auth tree to ldap-and-duo)
See the laravel-soa documentation for full details on configuring Online Passport.