Okta SAML Login Failing: "Could not parse SAML response"

Hi community,

I’m trying to set up SAML Single Sign-On with [ Okta] and I’m running into an issue.

When I test the login process, n8n returns the following error:

{“code”:401,“message”:“SAML Authentication failed: SAML Authentication failed. Could not parse SAML response. ERR_REDIRECT_FLOW_BAD_ARGS”}

I’m self hosting, also we have the Enterprise version.

So far, I have tried:

  • Re-copying the IdP Metadata XML from my provider into n8n.
  • Double-checking that the Redirect URL and Entity ID in my provider’s settings match n8n exactly.

I feel like I’m missing a simple configuration step. Has anyone run into this specific ‘Could not parse’ error before? Any advice would be greatly appreciated.

Thanks!

Have you tried the “Test Settings” button? It’s on the /settings/sso page.

Yes, I am getting the error doing the “Test settings”

Next I would try turning on developer tools in your browser and try to see what is being passed around in each step, especially any GET parameters or POST body payloads. Make sure you have “preserve log” turned on in your developer tools because there are several redirects in the SAML redirect flow. It seems like something is getting garbled in one of the steps.

Also if you see a long long string in the payload, it’s likely base64 encoded and you can decode that with various tools and might see something in there as well.

Good luck!

1 Like

Thank you, will mark this as solved as it gave me more insight into troubleshooting.

Issue: We had an auth proxy setup, so excluded the /rest/saml/sso endpoint in the ingress. Fixed.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.