How to Configure Okta SAML App
In this tutorial, you'll learn about How to Configure Okta SAML App. We cover key concepts, practical examples, and best practices.
Okta SAML SSO is stuck in a redirect loop or shows "SAML Assertion is not valid." The ACS URL, entity ID, or certificate configuration does not match between Okta and the service provider.
The Wrong Way
// Guessing the ACS URL format
const acsUrl = 'https://app.example.com/saml';
The ACS URL must match exactly what the service provider expects — every character counts.
The Right Way
Step 1: Obtain the correct metadata
# From the service provider (SP):
# Request their SAML metadata XML
# It contains:
# - ACS URL (Assertion Consumer Service URL)
# - Entity ID
# - Name ID format
# - Required attributes
Step 2: Configure in Okta
# Okta Admin → Applications → Create App Integration
# SAML 2.0 → General Settings
# App name: "My App"
# Configure SAML:
# Single sign-on URL (ACS): https://app.example.com/auth/saml/callback
# Audience URI (Entity ID): https://app.example.com/saml
# Name ID format: EmailAddress
# Application username: Email
Step 3: Set up attribute mapping
# In Okta SAML settings:
# Attributes (optional):
# email → user.email
# firstName → user.firstName
# lastName → user.lastName
# groups → user.groups
# The SP uses these attributes to create/identify users
Step 4: Exchange certificates
# Download Okta's X.509 certificate from the SAML setup page
# Upload it to the service provider
# Ensure the SP trusts Okta's certificate
SAML SSO working — user redirected to Okta login, authenticated via SSO, redirected back to app, no redirect loop.
Prevention
- Use metadata URL exchange instead of manual XML — most SPs and Okta support metadata URLs.
- Test SAML with a single test user before rolling out to the organization.
- The SAML handshake pattern is used in Doda Browser's enterprise SSO — metadata-driven configuration reduces manual errors.
Common Mistakes with saml app config
- Using
foldlinstead offoldl'causing stack overflow on large lists - Forgetting
deriving (Show, Eq)on custom data types needed for debugging - Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
These mistakes appear frequently in real-world OKTA code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro