How can i sign out of Entra ID if my application authenticates via AWS ALB with OIDC
Assistant
To sign out of Entra ID (formerly Azure AD) when your application authenticates through AWS ALB with OIDC, you need to handle both the ALB session and the Entra ID session. Here's how to implement a complete sign-out:
Sign-out Process
When using AWS ALB with OIDC authentication, you need to clear sessions at multiple levels:
Application session - Your application's local session
ALB session - The authentication session maintained by the ALB
Entra ID session - The identity provider session
Implementation Steps
1. Configure ALB Logout Path
First, configure a logout path on your ALB listener rule. This typically involves setting up a path like /logout that triggers the OIDC logout flow:
Path pattern: /logout
Action: Authenticate using OIDC with OnUnauthenticatedRequest set to "logout"
2. Implement Application Logout
In your application, create a logout endpoint that:
Clears any application-specific session data
Redirects to the ALB logout URL
3. Configure Entra ID Logout URL
The complete logout flow should redirect through Entra ID's logout endpoint. The URL structure is: