Back
OIDC Auth Issues: Invalid Redirect and callback/redirect after authentication is missing port number
- 0
- Self Hosted
- Auth
- Web

I am using self hosted Zitadel with OpenID connect. The first error I'm getting is:
TypeScript
at o.<anonymous> (https://cdn.jsdelivr.net/npm/appwrite@16.0.0:7:7420)
at Generator.next (<anonymous>)
at s (https://cdn.jsdelivr.net/npm/appwrite@16.0.0:7:111)```
When I paste the following request url
> https://my.id/oauth/v2/authorize?client_id=0000000000000000%40dev&redirect_uri=http%3A%2F%2Flocalhost%2Fv1%2Faccount%2Fsessions%2Foauth2%2Fcallback%2Foidc%2Fsaas-dev&state=%7B%22success%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A1337%5C%2F%22%2C%22failure%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A1337%5C%2F%22%2C%22token%22%3Afalse%7D&scope=openid+profile+email+saas-dev&response_type=code
I get the following as a callback:
> http://localhost/v1/account/sessions/oauth2/callback/oidc/saas-dev?code=sTPUyO5jcH9N68PekVirwpFccKZVw5WYOoTm_1F-3a2qNA&state=%7B%22success%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A1337%5C%2F%22%2C%22failure%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A1337%5C%2F%22%2C%22token%22%3Afalse%7D
and the following redirect:
> http://localhost/v1/account/sessions/oauth2/oidc/redirect?code=sTPUyO5jcH9N68PekVirwpFccKZVw5WYOoTm_1F-3a2qNA&state=%7B%22success%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A1337%5C%2F%22%2C%22failure%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A1337%5C%2F%22%2C%22token%22%3Afalse%7D&project=saas-dev
When I add the portnumber to the URL I then get the following error:
> {"message":"Server Error","code":500,"type":"general_unknown","version":"1.5.10"}
Any Ideas what is causing the issue?
TL;DR
Issues with OIDC authentication:
- Invalid redirect error when using Zitadel self-hosted with OpenID connect.
- Callback/redirect after authentication is missing the port number.
- Error message "Server Error" with code 500 when adding the port number to the URL.
Possible Solution:
Ensure the correct redirect URI with the port number is configured in the OIDC settings to resolve the callback and redirect errors.Recommended threads
- Selfhosting problem
I'm migrating from cloud to self-hosted. I tried using 'Export to self-hosted instance' and use my free Ngrok domain as Endpoint self-hosted instance, but I got...
- Need help setting up this error is showi...
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cl...
- Direct Upgrade from Appwrite v1.5.11 to ...
I'm on Appwrite v1.5.11. Can I upgrade directly to v1.6.2?
