Prompt
How do I troubleshoot an Okta integration that works in test but not production?
Latest observation
When an Okta integration works in test but fails in production, the issue is usually one of these: different app configuration, callback/redirect mismatch, environment-specific credentials, network restrictions, user/group assignment, or token/issuer differences.
Here’s a practical troubleshooting checklist.
1) Confirm the environments are truly equivalent
Compare test vs. production for:
- Okta org/domain
- Different Okta tenants often have different policies and app settings.
- Client ID / Client Secret
- Make sure production is using the prod app credentials, not test values.
- Issuer / Authorization Server
- Examples:
- Org authorization server:
https://{yourOktaDomain} - Custom authorization server:
https://{yourOktaDomain}/oauth2/{authServerId}
- Org authorization server:
- A mismatch here can cause token validation or login failures.
- Examples:
- Redirect URI / Callback URL
- Must match exactly in Okta and in your app:
- scheme (
httpsvshttp) - host
- port
- path
- trailing slash
- scheme (
- Must match exactly in Okta and in your app:
- Scopes / Claims
- Production may need scopes or claims that were only configured in test.
- User/group assignment
- The app may be assigned to different groups in prod.
2) Check the Okta System Log
In the Okta admin console:
- Go to Reports > System Log
- Filter by:
- user
- app
- time window
- event type (
app.oauth2.*,user.authentication.*, etc.)
Look for:
invalid_clientredirect_uri_mismatchaccess_denied- MFA/policy enforcement
- Group assignment failures
- Sign-in policy rejections
The System Log often tells you the exact reason much faster than the app logs.
3) Compare app configuration in Okta
Check the app integration settings in both environments:
- Login redirect URIs
- Sign-out redirect URIs
- Grant types
- Authorization Code
- PKCE
- Client Credentials
- Implicit (if used)
- Response types
- Trusted Origins / CORS
- Token Endpoint authentication method
- client secret post
- private key JWT
- none
A common production-only failure is a grant type or redirect URI not enabled in the prod app.
4) Verify production network and DNS
Production may have network constraints that test doesn’t:
- Outbound firewall rules blocking Okta domains
- Proxy issues
- DNS resolution problems
- TLS inspection breaking OIDC calls
- Load balancer or reverse proxy rewriting headers
Check:
- Can prod servers reach:
/.well-known/openid-configuration/v1/authorize/v1/token/v1/userinfo
- Are requests going to the expected Okta domain?
- Is
X-Forwarded-Protocorrect if behind a proxy?
5) Inspect the actual runtime values in production
Don’t assume config is loaded correctly.
Log or inspect:
- issuer
- client ID
- redirect URI
- environment variables
- secret source
- callback URL generated at runtime
Look for:
- missing env vars
- wrong secret mounted
- stale config cache
- feature flags only enabled in test
6) Check browser and callback flow
If login starts but callback fails:
- Open browser dev tools
- Check:
- network requests
- redirects
- response codes
- cookies
- Confirm session cookies:
- are they set?
- marked
Secure? - blocked by
SameSitepolicy?
- If using cross-site redirects, ensure cookies are compatible with modern browser rules.
7) Validate token and claim handling
If authentication succeeds but your app rejects the user:
- Are you validating the right issuer?
- Is the audience (
aud) correct? - Has the signing key (
kid) changed? - Are you fetching JWKS from the right issuer?
- Did production start using a different authorization server?
- Is the user missing a required claim in prod?
Common issue:
- Test uses a custom claim/group mapping, but prod does not have the same group or policy.
8) Check MFA and sign-on policies
Production may enforce stricter policies:
- MFA required
- Device trust required
- Network zones
- Session policies
- Sign-on policy conditions based on IP, group, or app
The user might authenticate successfully in test but be blocked in prod because the prod policy is stricter.
9) Compare app assignment and permissions
If using SSO/OIDC/SAML:
- Is the user assigned to the app in production?
- Is the app assignment through a group that exists in prod?
- Are admin privileges needed for certain actions?
For SAML:
- Compare certificate, ACS URL, entity ID, and NameID format.
10) Reproduce with a minimal test
Try the exact production config in a controlled way:
- Use a known prod user
- Use a minimal login flow
- Capture raw OAuth/OIDC requests
- Test with Postman/curl where possible
- Compare test vs. prod authorization responses
11) Common “works in test, fails in prod” causes
Here are the most frequent culprits:
- Redirect URI mismatch
- Wrong issuer/authorization server
- Wrong client secret
- App not assigned to the user/group in prod
- Production firewall/proxy blocks Okta
- MFA or sign-on policy differences
- Missing custom claims/scopes in prod
- Cookie/SameSite issues due to HTTPS or proxy differences
- Different Okta org or app integration configuration
- Production callback path differs because of routing or base URL
12) A quick way to isolate the problem
Ask these questions in order:
- Does the login request reach Okta?
- Does Okta return an error in the System Log?
- Does the callback hit the production app?
- If yes, does token exchange succeed?
- If yes, is token validation failing?
- If validation passes, is your app’s authorization logic failing?
That sequence usually narrows the issue fast.
If you want, I can help you debug it step-by-step if you share:
- the protocol you’re using (OIDC or SAML),
- the exact error message,
- where it fails in the flow,
- and whether test/prod use the same Okta org.