Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Okta okta.oauth2.redirect-uri property should not be automatically prefixed with {baseUri} #778

Open
jirislovak-s1 opened this issue Feb 28, 2025 · 0 comments

Comments

@jirislovak-s1
Copy link

Hi,
the OKTA property okta.oauth2.redirect-uri is automatically prefixed with {baseUrl} computed from current request values.
This does not work when OKTA application is deployed behind some proxy with different url.
The only way how to overcome this problem and set full url (like https://proxy.com/{action}/oauth2/code/{registrationId}) is to set directly spring.security.oauth2.client.registration.okta.redirect-uri and avoid using okta.oauth2.redirect-uri as X-* headers are not allowed to use in my case.

I would suggest to remove {baseUrl} from this line in OktaOAuth2PropertiesMappingEnvironmentPostProcessor.java and let the developer decide whether the uri should be automatically computed or not:

properties.put("spring.security.oauth2.client.registration.okta.redirect-uri", "{baseUrl}${okta.oauth2.redirect-uri}");

Or is there any reason why baseUrl must be always computed?

Thanks a lot,
Jiri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant