Skip to content

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

@jirislovak-s1

Description

@jirislovak-s1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions