Coder Social home page Coder Social logo

How to override the behavior of OktaOAuth2PropertiesMappingEnvironmentPostProcessor in a @SpringBootTest about okta-spring-boot HOT 3 CLOSED

danallen88 avatar danallen88 commented on July 17, 2024
How to override the behavior of OktaOAuth2PropertiesMappingEnvironmentPostProcessor in a @SpringBootTest

from okta-spring-boot.

Comments (3)

arvindkrishnakumar-okta avatar arvindkrishnakumar-okta commented on July 17, 2024

@danallen88 Thanks for posting!

The discovery of OIDC metadata from .well-known/openid-configuration is done automatically by Spring OIDC client during the registration process and this behavior is embedded inside the Spring Security framework and Okta does not define it. There is no known documented way in Spring framework to bypass this.

For testing purposes, if you have concerns about public internet calls, you could mock the metadata, serve a static metadata by using a framework such as Wiremock. In fact, this SDK has such tests inside oauth2/src/test/ that you can use for reference.

Let me know if that helps!

from okta-spring-boot.

danallen88 avatar danallen88 commented on July 17, 2024

Thank you @arvindkrishnakumar-okta for confirming that there is no known documented way in Spring to bypass this, and thank you for pointing me to the tests that shows how Wiremock is used. Is this an example of such a test? https://github.com/okta/okta-spring-boot/blob/master/oauth2/src/test/groovy/com/okta/spring/boot/oauth/env/OktaOAuth2PropertiesMappingEnvironmentPostProcessorTest.groovy

from okta-spring-boot.

arvindkrishnakumar-okta avatar arvindkrishnakumar-okta commented on July 17, 2024

Sure, please take a look at tests in oauth2/src/test/groovy/com/okta/spring/boot/oauth/.

from okta-spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.