Application Load Balancer (ALB) supports user authentication through OpenID Connect (OIDC) with external Identity Providers (IdPs). This article walks through how to configure user authentication on an ALB using Okta as your OIDC provider.
Prerequisites
- An AWS account with an ALB deployed
- A custom domain with DNS pointing to the ALB
- An HTTPS listener configured on the ALB
- An Okta account (sign up for a free 30-day trial)
Note: Okta requires a custom domain for the redirect URI. You cannot use the default ALB DNS name. Make sure your custom domain resolves to the ALB and that the HTTPS listener is configured with a valid certificate for that domain.
Step 1: Create an Okta Application
- Log in to the Okta Admin Console.
- Navigate to Applications > Applications.
- Click Create App Integration with the following settings:
- Sign-in method: OIDC - OpenID Connect
- Application type: Web Application
- Under General Settings:
- App integration name:
App (or your preferred name)
- Grant type: Authorization Code
- Set the Sign-in redirect URI to:
https://<ALB_CUSTOM_DOMAIN>/oauth2/idpresponse
- Under Controlled access, assign access to specific users or groups that require access to the application.
- After creation, note the Client ID and Client Secret — you will need these when configuring the ALB listener.
Step 2: Add an Access Policy to the Authorization Server
-
In the Okta Admin Console, go to Security > API.
-
Select the default authorization server.
-
Go to the Access Policies tab and click Add New Access Policy.
-
Add a rule with the following settings (for testing purposes):
| Setting | Value |
|---|
| Grant type | Authorization Code |
| User | Any user assigned the app |
| Scopes requested | Any scopes |
| Inline hook | None (disabled) |
| Access token lifetime | 1 Hour |
| Refresh token lifetime | 1 Day |
| Refresh token expires if not used every | 12 Hours |
-
Note the Okta Authorization Server DNS (e.g., trial-0000000.okta.com).
Step 3: Configure the ALB Listener
- Configure the HTTPS listener on your ALB with the following settings:
- Protocol: HTTPS
- Port: 443
- Default action: Authenticate user
- Under the OIDC identity provider configuration, fill in the endpoints using your Okta Authorization Server DNS (Okta OpenID Connect & OAuth 2.0 API):
| Field | Value |
|---|
| Issuer | https://<OKTA_DNS>/oauth2/default |
| Authorization endpoint | https://<OKTA_DNS>/oauth2/default/v1/authorize |
| Token endpoint | https://<OKTA_DNS>/oauth2/default/v1/token |
| User info endpoint | https://<OKTA_DNS>/oauth2/default/v1/userinfo |
| Client ID | (from Step 1) |
| Client Secret | (from Step 1) |
These endpoints are from the Okta default Custom Authorization Server. You can verify them by accessing the well-known configuration URL:
https://<OKTA_DNS>/oauth2/default/.well-known/openid-configuration
Reference: Okta Authorization Servers
-
Set the Routing action to Forward to target group.
-
For details on the ALB OIDC listener configuration fields (Issuer, AuthorizationEndpoint, TokenEndpoint, UserInfoEndpoint), see AuthenticateOidcActionConfig in the ALB API Reference.
References