okta / okta-spring-boot

Okta Spring Boot Starter
324 stars 136 forks source link

OktaOAuth2PropertiesMappingEnvironmentPostProcessor does not respect okta proxy settings #693

Open ndk- opened 5 months ago

ndk- commented 5 months ago

:information_source: If you have a question, please post it on the Okta Developer Forum instead. Issues in this repository are reserved for bug reports and feature requests only.

I'm submitting a

Background info

OktaOAuth2PropertiesMappingEnvironmentPostProcessor does not respect okta proxy settings

Take a look at https://github.com/okta/okta-spring-boot/blob/master/oauth2/src/main/java/com/okta/spring/boot/oauth/env/OktaOAuth2PropertiesMappingEnvironmentPostProcessor.java. It instantiates RestTemplate without any regard to okta proxy settings and immediately tries to fetch well known configuration.

Expected behavior

OktaOAuth2PropertiesMappingEnvironmentPostProcessor uses okta proxy settings to fetch .well-known configuration

What should have happened?

What went wrong?

OktaOAuth2PropertiesMappingEnvironmentPostProcessor uses RestTemplate with no respect to okta proxy settings.

Please provide log or error messages if applicable. No need to

Steps to reproduce

  1. Limit all connections from machine
  2. Use okta proxy settings to connect to okta
  3. Observe that fetching .well-known configuration is failing due to step 1

If the current behavior is a bug, please provide the steps to reproduce and a minimal demo if possible.

SDK Version

Latest stable