Skip to content

[Bug]: OIDC Adds ":" to redirect URI even though no port is specified in URL. #7278

@benshalev849

Description

@benshalev849

Version

3.7.0

What Kubernetes platforms are you running on?

Openshift

Steps to reproduce

We are deploying the NGINX as usual and using the "NGINX OIDC" policy.
When using it and diving into some of the code we saw that the redirect URI automatically adds a : in the redirect URI which can break it and doesn't make much sense. (In our env it's a problem since specifying ports is not allowed in redirect_uris.)

As seen in the following file on line 6-9: internal/configs/oidc/oidc_common.conf

We saw that there is mapping of the redirect URI based on $server_port and $http_x_forwarded_port.

When using HTTPS there is no port "specified" thus if our domain is: my-oidc-tests.com it will result in the following redirect URI: https://my-oidc-tests.com:/_codexch which breaks our SSO provider.

We think a better solution is adding the : and a port only when it actually exists or even have an option to toggle it on or off.

I opened under a bug because we are not sure if this is intended behaviour (the default adding of : into the URI or not.)

Thank you :)

Metadata

Metadata

Labels

bugAn issue reporting a potential bugwaiting for responseWaiting for author's response

Type

No type

Projects

Status

Done 🚀

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions