Java/Spring Quickstart Skip to main content
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Gary EnglandGary England 

Java/Spring Quickstart


I'm trying to implement the guide found here:

I got the Angular 2 front-end app implemented and running and working perfectly. Redirects to our Okta preview site, redirects back, all that. Now I'm working on the Java/Spring API backend piece. According to the guide, it's quite simple. Install the Okta dependency, add your configs, add a controller, and you're off and running.

However, I have found that I once I install the Okta dependency (I spun up an new Spring Boot Web MVC app), I experience CORS issues. I have implemented CORS in two ways:
In the API:
In Okta:

However, that still doesn't resolve the CORS issue. After trying every which way under the sun to overcome the CORS issue, I found this solution and implemented it:

But, that doesn't "feel" right. I don't think, after doing the two CORS solutions above, I should still be running into any CORS issues. So, after implementing that last CORS solution, I no longer get CORS issues. However, now I get the following error in the front-end console:

An I/O error occurred while reading from the JWK Set source: Server returned HTTP response code: 403 for URL: https://{mydomain}

Any advice on the CORS issue, or this I/O error issue would be much appreciated. I'm hitting a wall with this.


Eugen DumitruEugen Dumitru (Okta, Inc.)
Hi Gary,
The Forbidden access error might be that CORS and Redirect isn't configured in Okta or it might be as it's described on this thread . 
You can ask the Developers for information @ or if feel it's an issue you can always create a case.

Thank you,
Eugen Dumitru
Sudhakar PolamreddySudhakar Polamreddy
Hi Eugen/Gary,

Have you implemented OKTA integration with your Java application? I am trying to integrate my Java Web Application with Okta using openid connect. Appreciate any help on going with the right direction of implementation. There are different ways that I have seen in the forums, Spring, Apachi Shino and Rest API calls. I started with Spring security and stuck in the middle. Please suggest the best way. We want to go with custom login page.