External User Not Found when trying to auto link SAML Users by Email
Hi,
I have set up Okta as an Identity Provider on Zitadel, and I am trying to get the auto linking part of it working.
I have a created a user in Zitadel with the same email as my Okta account. Now when I click Sign In with Okta, on the login screen, I get External User Not Found.
I've played around with different settings on both Zitadel and Okta side and currently, I think I have all this set up correctly.
I've been digging in the source code and the database a little bit, and I think the issue might be on this file here: https://github.com/zitadel/zitadel/blob/e57a9b57c8e770383316599a338ceef023d96de6/internal/idp/providers/saml/mapper.go#L57
All other providers have this interface implemented, however it seems like saml doesn't really link any attributes besides the ID, so when checkAutoLink function is called, all the properties here are returned empty (including email and username).
Is this intentional or is there something I might be doing wrong?
My IDP template configuration as a reference:
Thank you 🙏
GitHub
zitadel/internal/idp/providers/saml/mapper.go at e57a9b57c8e7703833...
ZITADEL - Identity infrastructure, simplified for you. - zitadel/zitadel
4 Replies
For anyone that runs into this same issue, there's a workaround with using actions:
You set this as the action to trigger on : External Authentication - Post Authentication to add the details to your external user using the details received from your provider.
Then after this step, zitadel is going to check and auto-link your external user.
I got a linked user, but zitadel still let me input code and password, is there anyway to auto link.


hey @巾水 you can create a new human user and link you IDP on the fly
https://zitadel.com/docs/apis/resources/user_service_v2/user-service-add-human-user
then pre-fill the idpLinks with your IDP details.
Thanks for your reply. I was thinking if this will create a new account or use the linked account. Actually I have a freeipa idp already, and I add a dingtalk idp , I want the dingtalk idp link the freeipa idp automaticly. As you see zitadel has link the two idps, but I don't want user input anyting , I want user use dingtalk login with the freeipa account. Thanks again.