
DigamaS.67942 (Customer) asked a question.
We have an application called mastercontrol that is integrated to Okta using SAML 2.0. We have another set off SAML 2.0 users that access the application via org2org connection. One of the SAML 2.0 user migrated to our Okta and trying to accessing the mastercontrol application from the original SSO configured tenant but getting "Unexpected Error while authenticating with Identity Provider". The MC uses Keycloak. I did a SAML tracer and found 501 internal server error.

Hi @DigamaS.67942 (Customer) Thank you for posting on our Community page!
A 501 error typically indicates a server-side issue on the identity provider (Keycloak) side, often caused by a mismatch between what Okta is sending in the SAML assertion and what Keycloak expects to receive.
Root Cause: When a user migrates from one Okta tenant to another, their username, email, or other SAML attributes may change or be formatted differently. If the org2org SAML connection is still configured to send the old attribute values or format, Keycloak rejects the assertion because it cannot match the user or validate the request structure. Additionally, org2org connections are sensitive to issuer mismatches, audience restrictions, and assertion consumer service URL validation.
Resolved: Follow these steps to diagnose and fix the issue:
If these steps do not resolve the issue, contact Okta Support with the SAML tracer output, the Keycloak error logs, and confirmation of the org2org configuration details so they can verify the tenant-to-tenant SAML flow and attribute mapping.
Thank you for reaching out to our Community and have a great day!
--
Help others in the community by liking or hitting Select as Best if this response helped you.
Securing AI agents across your org? Join our upcoming Ask Me Anything on 8/5 about Okta for AI Agents. Ask our expert questions.