Skip to content

How to Configure Okta SAML App

DodaTech Updated 2026-06-24 2 min read

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

  1. Using foldl instead of foldl' causing stack overflow on large lists
  2. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  3. 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

### What causes a SAML redirect loop?

The ACS URL in Okta does not match what the service provider expects. When the SP receives the SAML response, it cannot match the ACS URL and sends the user back to Okta, creating a loop. Verify the ACS URL character-for-character.

How do I decode a SAML response for debugging?

# SAML responses are base64-encoded XML
# Decode with:
echo "PHNhbWxw..." | base64 -d | xmllint --format -
# Look for: StatusCode, Issuer, Subject, Conditions

Okta also provides SAML debugging in the developer dashboard.

What is the difference between SP-initiated and IdP-initiated SSO?

SP-initiated: user accesses the app first, gets redirected to Okta for login. IdP-initiated: user logs into Okta dashboard first, clicks the app icon. Both use the same SAML configuration. The ACS URL is the same for both flows.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro