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

Add support for JVM proxy system properties to the Oauth2 Client support, when creating RestTemplates #9101

Closed
car51901 opened this issue Oct 6, 2020 · 1 comment
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue

Comments

@car51901
Copy link

car51901 commented Oct 6, 2020

Expected Behavior

Spring Security OAuth2 clients work when the authorization server/provider, e.g. Okta, have to be accessed through a proxy server, as when running app on a corporate network. Oauth2 Clients should honor/support the JVM proxy system proprties, e.g. https.proxyHost, https.proxyPort.

Current Behavior

In older versions of Spring Security (5.0.8) and Spring Boot (2.0.x), and at least when using the Okta oauth starter (0.6.0), proxy support worked, when setting https.proxyHost and https.proxyPort system properties, e.g. via -D arguments passed to JVM.

In newer versions, Spring Boot 2.2.x, Spring Security (5.2.x), and Okta extensions (1.3.0), the JVM proxy config appears to be ignored. Appears implementations create a RestTemplate out of the box, and JVM proxy config is not honored, nor is there any clear/easy way to configure the RestTemplate, without supplying your own customized implementation. The app fails at startup, trying to get the Outh2 config, e.g "https://dev-nnnn.okta.com/oauth2/default/.well-known/openid-configuration", can't connect, and won't use the jvm proxy config.

This has been noted before, see, but that thread seems to focus on overriding the RestTemplate. Don't see why the JVM system props can't be used, if defined, to configure the default RestTemplate, without having to provide custom user service implementations:
#7027

Context

As noted, older versions of boot and security honored the JVM proxy system properties, newer versions do not.

@jgrandja
Copy link
Contributor

jgrandja commented Nov 6, 2020

@car51901 Closing as duplicate of #8882 as it's closely related. Also, please see this comment.

@jgrandja jgrandja closed this as completed Nov 6, 2020
@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants