Giter Site home page Giter Site logo

Comments (5)

bdemers avatar bdemers commented on September 20, 2024

Thanks @landon-shumway! This is NOT expected, caching is actually disabled:
https://github.com/okta/okta-auth-java/blob/master/impl/src/main/java/com/okta/authn/sdk/impl/client/DefaultAuthenticationClient.java#L68

The Javadoc is wrong, we will fix that (it was likely a copypasta from our Management SDK)

As for the cache issue, do you have any OKTA_* environment variables, or a ~/.okta/okta.yaml file.

from okta-auth-java.

landon-shumway avatar landon-shumway commented on September 20, 2024

We do not. We only set the URL to our Okta account which is defined as a static constant in the same Java class as that code snippet.

from okta-auth-java.

arvindkrishnakumar-okta avatar arvindkrishnakumar-okta commented on September 20, 2024

@landon-shumway Thanks for raising this! Just so I understand the issue better, how are you executing the /oauth2/v1/authorize call and the next /oauth2/v1/token call? In other words, I assume the Auth SDK is used only for the first session token call, right?

from okta-auth-java.

landon-shumway avatar landon-shumway commented on September 20, 2024

@arvindkrishnakumar-okta We use RestTemplate to call the /oauth2/v1/authorize endpoint, and then we extract the access token from the location header (this snippet if pulled together from several functions, so I apologize if I'm missing a step here):

ResponseEntity<String> response = restTemplate.exchange(authorizeUrl, HttpMethod.GET, entity, String.class);
URI location = response.getHeaders().getLocation();
 List<NameValuePair> queryValues = URLEncodedUtils.parse(location.getFragment(), Charsets.UTF_8);
 Optional<NameValuePair> accessToken =
     queryValues.stream().filter(x -> x.getName().equals(ACCESS_TOKEN_NAME)).findFirst();


return accessToken.get().getValue();

Yes, we were only using the Auth SDK to generate the OIDC session token. All of our other calls to Okta are made through RestTemplate.

from okta-auth-java.

arvindkrishnakumar-okta avatar arvindkrishnakumar-okta commented on September 20, 2024

@landon-shumway is this still an issue?

Feel free to reopen with comments if needed.

from okta-auth-java.

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.