Nadine
Nadine2mo ago

Microsoft IdP Login Fails: Missing given_name Causes Validation Error

Hello, I'm setting up Microsoft as an Identity Provider for my app using Zitadel. I followed all the documentation, and login is successful, but right after that, I run into this error: [invalid_argument] invalid AddHumanUserRequest.Profile: embedded message failed validation | caused by: invalid SetHumanProfile.GivenName: value length must be between 1 and 200 runes, inclusive Even though I have added given_name as a claim in the token configuration of my Azure App Registration, It seems like it might be missing or empty in the token being returned. Can anyone help me identify why this might be happening or suggest a workaround? maybe creating an action to map name to given_name can fix this (not sure if possible)? Thanks so much in advance! 🙏
No description
53 Replies
Nadine
NadineOP2mo ago
Azure app token configuations:
No description
Rajat
Rajat2mo ago
hey @Nadine good morning and welcome to the server, can you pls share the jwt (if its not anything sensitive) here so I can check it ?. Also which doc did you followed to setup the idp?. Thanks
Nadine
NadineOP2mo ago
Helloo @Rajat , thank you soo much for answering! This is the doc I followed https://zitadel.com/docs/guides/integrate/identity-providers/azure-ad-oidc#entra-id-configuration and as for the token, I believe that I dont have any visibility over it (checked the network tab and console.. nothing)
ZITADEL Docs
Open the Microsoft Identity Provider Template
Rajat
Rajat2mo ago
hey @Nadine yiu can catch the raw jwt token, from browser's Network tab, look for id_token in the response after login, or soemthing like that field, it should have the raw token that is being rejected , also, I am hoping that all the field that you are sending in the claims are pre filled too because if they'd be empty, that could also lead to error like above
Nadine
NadineOP2mo ago
@Rajat There is nothing :/ Yes they are prefilled in azure AD
Nadine
NadineOP2mo ago
No description
Rajat
Rajat2mo ago
hey @Nadine I just notices, have you followed all the steps? https://zitadel.com/docs/guides/integrate/identity-providers/azure-ad-oidc or just the config part?
Rajat
Rajat2mo ago
can you pls filter with just token, it should be generated , I tested it on idps/password logins, it will show the claims and why is it failing
No description
Nadine
NadineOP2mo ago
I dont see a token call like the one you are mentioning, when I search for token the only call I get is this one: And it s the one returning the success page, witht he error that I am seeing
No description
Nadine
NadineOP2mo ago
All of it 🙂
oldjazjef
oldjazjef2mo ago
We are having the same issue. The token received from the tenant comes in the query param of the url and is opque, so no chance to extract information from it. our-domain.zitadel.cloud/ui/v2/login/idp/azure/success?id=331293367411442365&requestId=oidc_V2_331293362361481420&token=TWAYBDxsNT.... We also checked our AD and all the required data and scopes are applied. We followed all the steps from: https://zitadel.com/docs/guides/integrate/identity-providers/azure-ad-oidc Are there any news regarding this? Thanks 🙂
ZITADEL Docs
Open the Microsoft Identity Provider Template
Rajat
Rajat2mo ago
I configured it too, and is missing the id_token coming in, but is visible on browser network tab, what exactly is the end goal you want @oldjazjef ?. Maybe a bit more clarity would help me
Blemming
Blemming2mo ago
I am having the same issue with microsoft provider, it seems entraID is sending a JWT as user and zitadel cannot parse it, looking through the events microsoft is sending idpUser as a JWT, decoded here is what my it looks like:
{
"id": "8402802d-2c16-4bec-b7bc-xxxxxxxx",
"businessPhones": [
"xxxxxxxxx"
],
"displayName": "Dustin xxxxxxx",
"givenName": "Dustin",
"jobTitle": "Team Leader Web development",
"mail": "Dustinxxxxxxxxxxxx@xxxxxxxxx",
"mobilePhone": "",
"officeLocation": "BCA",
"preferredLanguage": "",
"surname": "xxxxxxx",
"userPrincipalName": "Dustinxxxxxxx@xxxxxxxxxx"

}
{
"id": "8402802d-2c16-4bec-b7bc-xxxxxxxx",
"businessPhones": [
"xxxxxxxxx"
],
"displayName": "Dustin xxxxxxx",
"givenName": "Dustin",
"jobTitle": "Team Leader Web development",
"mail": "Dustinxxxxxxxxxxxx@xxxxxxxxx",
"mobilePhone": "",
"officeLocation": "BCA",
"preferredLanguage": "",
"surname": "xxxxxxx",
"userPrincipalName": "Dustinxxxxxxx@xxxxxxxxxx"

}
I redacted sensitive information
Rajat
Rajat2mo ago
did you get this info on the console tab under id_token?
Blemming
Blemming2mo ago
in events , event type: EventTypes.idpintent.succeeded , under the field idpUser
Blemming
Blemming2mo ago
No description
Blemming
Blemming2mo ago
like the others filtering for token in the network tab only gives me the success url iwth no id_token anywhere in sight
Rajat
Rajat2mo ago
yes same happening for me, but that means azure is not sending the id_token to zitadel I think or else it could be a bug tooo
oldjazjef
oldjazjef2mo ago
So the goal is: We have an angular app which uses Zitadel cloud for auth. In zitadel we added our organizations tenant (microsoft) as external identity provider. So the idea is to use either the zitadel users (manually added) or the external identity providers users through the oidc workflow. I managed to make it work by not checking "refresh token" and by not using the new Login UI. I will do further testing and send what I can find out
Rajat
Rajat2mo ago
it printed id_token in network tab for me
No description
Blemming
Blemming2mo ago
ill try again nop still only 1 token, with the error OP posted above
Rajat
Rajat2mo ago
I spent the whole day today on this, and apart from id_token being wirtten on metadat, it works pretty well, when I try with different IDP, id_token is being added as metadata, but not sure why this is not the case woth azure
No description
Rajat
Rajat2mo ago
I also enabled this under auththeication(preview) in masft azure, I dnt have much idea about how things work in azure, but after readimg a bit, I foudn this option
Blemming
Blemming2mo ago
do you have msft provider working , or are you saying other providers work but not microsoft ?, what are you settings in the zitadel IDP configuration ?
Rajat
Rajat2mo ago
the above was tested on the msft idp
Rajat
Rajat2mo ago
No description
No description
Blemming
Blemming2mo ago
mine is identical to that
Blemming
Blemming2mo ago
No description
Rajat
Rajat2mo ago
check your manifest file
Blemming
Blemming2mo ago
manifest file ?
Rajat
Rajat2mo ago
I think?
No description
Blemming
Blemming2mo ago
i dont have access to azure, our parent company has access to it, i have to write to my contact give me a sec
Rajat
Rajat2mo ago
ah okay, all these issues are on aziure side, the idToken is generated as metadata on google IDP but fails on azure but both works in inpect element
Blemming
Blemming2mo ago
I gave him the docs from zitadel so the token configuration and api permissions should be as stated in docs, i need to add something that isnt in docs then i have to tell him
Rajat
Rajat2mo ago
suree
Blemming
Blemming2mo ago
another thing is the callback url zitadel gave me, azure wouldnt take it, it gave me this error: AADSTS50011: The redirect URI 'https://users-di4rcj.us1.zitadel.cloud/idps/callback' specified in the request does not match the redirect URIs configured for the application '1e928936-3ba6-4433-b5ac-21bc1d49248f'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this. so we changed the callback url to the one in the error message
Error AADSTS50011 the redirect URI does not match the redirect URIs...
Describes error AADSTS50011 that occurs when you sign in to an OIDC-based SSO application in Microsoft Entra ID.
Rajat
Rajat2mo ago
it would have been something like https://<your- domain>/ui/login/login/externalidp/callback pls check your "Add Provider" Zitadel Callback URL
Blemming
Blemming2mo ago
yes it was that, but azure gave me the error above when we configured it to that
Rajat
Rajat2mo ago
do you have a screenshot?
Blemming
Blemming2mo ago
of ?
Rajat
Rajat2mo ago
where the redirect URI was set for me this is how it looks liek and it works
No description
Rajat
Rajat2mo ago
the best way would be to open a new thread and I will take a look but that geing said, idkToken is not available when using azure IDP, I will check with my colluage if zitadel can soemthing do about it or not as it works for Google IDP
Blemming
Blemming2mo ago
like I said i dont have access to azure i sent the docs to my contact and he configured it exactly like the docs said until we got the rror then we changed the callback and then we got the error from OP
Rajat
Rajat2mo ago
okay, maybe they made a mistake or need to take a closer look with exact error and setup, I did setup on azure for the first time and it worked
Blemming
Blemming2mo ago
perhaps the OP made the same assumption I did with the callback, and it is not a good callback to get the id token
Rajat
Rajat2mo ago
yes, I am still very confused on that note, but the setup should work if followed correctly and IDP just works
Blemming
Blemming2mo ago
also before the callback error we got this error : Request Id: df84388e-b0a0-4e6e-ba56-c9e02a9f4400 Correlation Id: 961f6dfe-be9d-470e-a33b-06beb8553901 Timestamp: 2025-07-31T12:32:09Z Message: AADSTS50194: Application '1e928936-3ba6-4433-b5ac-21bc1d49248f'(ZITADEL BCA) is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant. we configured the app to be multi-tenant then that led to the callback error
Rajat
Rajat2mo ago
can you pls open a new issue with all teh details, I can have a better look tomorrow
Blemming
Blemming2mo ago
sure
Rajat
Rajat2mo ago
thanks
Blemming
Blemming2mo ago
btw is your project using the new login page ?
Blemming
Blemming2mo ago
No description
Rajat
Rajat2mo ago
no, I didnt have app setupon my zitadel, but I am not using login UI V2

Did you find this page helpful?