Service User - Oauth token fetch Fails with 500 Internal Error
Use-case: A multitenant SaaS solution where a tenant superuser can manage users from their own application through the SaaS platform. The Admin API will be handled via my Service account and it will manage the users on the super user's request
Environment: Zitadel Cloud
Version: V2 (for the Admin API requests)
Stack: Python + React
I want to test my service account for which I granted all rights at the instance level. See screenshot. I'm following the guide described in https://zitadel.com/docs/guides/integrate/service-users/private-key-jwt
I succeed in creating the JWT but as soon as I request the Oauth token, I get a 500. If my credentials were wrong, I would expect a 4XX.
Attached, you can find my Python script that I used for debugging.
Is there a way for me to see the server logs to understand the "Errors.Internal" ?
Could there be an issue at Zitadel's side?
16 Replies
hi @Neymar is dood
I see this
I see double quotes followed by single quotes here
"scope": "'openid urn:zitadel:iam:org:project:id:zitadel:aud'",
can you please change it to "scope": "openid urn:zitadel:iam:org:project:id:zitadel:aud"
and try again?. Please let me know.
ThanksHey @Rajat
Thanks for looking into it. I just tried, but this does not change anything.
Note that I also print out the CURL command, and this gives the same result.
Eg: (with redacted token)
ah okay, sure , are authenticating with a Service User, correct?
Yes. That's the one from the screenshot.
But even if I would use the wrong user, shouldn't this give a 4XX instead of a 500?
hey @Neymar is dood I looked more and it seems like a known issue
https://github.com/zitadel/zitadel/issues/9745
would be nice if you can update your findings here
It's very close. But not exactely the same as it's for a "not Service User"
See:
5. An error is returned If the same process is used to sign a token using the private key downloaded for a service user, the request works as expectedBut I can add it there.
yes please update the issue
Do you know if I can see some server side logs somewhere?
Hey @Neymar is dood good morning!
Unfortunately you can't access server side logs.
Monitoring and log analysis are ONLY be viewed internally by the devs at Zitadel.
The only things you as a user can do is access Audit Log and Events API.
I see the same problem, I'm using pulumi zitadel provider, that used to work and wasn't upgraded recently
unlike the GH issue, it's a service user
hey @Rafael can you pls open a new issue: https://discord.com/channels/927474939156643850/1309166758699208785
I will take a look at it
@Rafael can comment on https://github.com/zitadel/zitadel/issues/9745 too? this will give at a bit more tracktion
GitHub
[Bug]: Token endpoint returns 500 for Private Key JWT using API app...
Preflight Checklist I could not find a solution in the documentation, the existing issues or discussions I have joined the ZITADEL chat Environment ZITADEL Cloud Version v2.70.8 Database None Datab...
I had/ have the same issue. My comment is on https://github.com/zitadel/zitadel/issues/9745
GitHub
[Bug]: Token endpoint returns 500 for Private Key JWT using API app...
Preflight Checklist I could not find a solution in the documentation, the existing issues or discussions I have joined the ZITADEL chat Environment ZITADEL Cloud Version v2.70.8 Database None Datab...
Just an update, it turned out to be a skill issue. All resolved now.
hi @FriendlyForeignAgent good morning, could you please elaborate what did you do to solve it?. Seems like few others in the thread had the same issue
@Rafael I can no longer reproduce my issue. See screenshot for the "fix"
