Human users created with terraform cannot login with v2 login unless username is email
I don't know if I'm doing something very wrong or if there is a strange bug. I'm trying to set up human users using the terraform provider (latest version of both tf provider and zitadel installed using the helm chart with traefik ingress).
If I set the username to anything other than the email address, the login fails for both email and username in v2 login with "User not found." v1 login works fine, so it seems the issue is v2 login and not zitadel itself or the tf provider.
Anyone else encountered this? Is this a known limitation that I just missed, or is this a real bug?
Here's a little snippet of my tf in case anything jumps out:
4 Replies
Hi @spacemule, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Answer
I wasn't able to find a direct answer in the available sources about this specific v2 login behavior with Terraform-created users where the username differs from the email address.
Here are some potentially relevant sources:
1. Custom Login Screen for Zitadel - Username & Password Authentication Issue (1) : This discussion mentions that when using the Session API with v2 login, the user identified an issue where using the email value in
loginName didn't work, but using the 'Preferred login name' did work . The user noted they have two available login methods: 'Preferred login name' and email, and needed to authenticate using email for multi-tenant scenarios .
2. Setting up Project and App from zero using Terraform Provider (Docker Compose) (2) : This provides examples of setting up ZITADEL with Terraform, including user creation configuration .
Would you like me to provide a general answer based on my knowledge of ZITADEL's authentication mechanisms?
ā
To learn more, see the sources I considered:
[1] Custom Login Screen for Zitadel - Username & Password Authentication Issue
[2] Setting up Project and App from zero using Terraform Provider (Docker Compose)
ā
Feel free to tag @Ask Inkeep with additional questions.Would you like me to provide a general answer based on my knowledge of ZITADEL's authentication mechanisms?@Ask Inkeep You can try
hey @spacemule thanks for your question, I will check with my team, it could be one of those V2 login bugs internally, could you please continue using V1 login for now if that's not a problem?. Thanks
yup. going to have to use v1 anyways as v2 doesn't trigger actions properly for external auth š¢