Has anyone successfully set this up, I’ve been through just about all the tutorials I can find and to no avail i’m still running into the following error
org.springframework.security.oauth2.client.resource.UserRedirectRequiredException: A redirect is required to get the users approval
I have a SPA in Okta and I’m using Implicit grant type.
Agreed, I ran through the same tutorial and it did work, but when I apply it to my existing project I get that error. Thanks a bunch for your help so far, I’ll keep an eye one the thread throughout the day.
My spring boot sever application.properties has the following properties
okta.oauth2.issuer=https://dev-{url}.oktapreview.com/oauth2/default
okta.oauth2.client-id={companyClientId}
And the reset is exactly as shown in the tutorial you posed above.
I do not, might you have a link on how to set up @EnableResourceServer? I’ve found something on the spring website but it’s not really clear. Thanks again!
My requests seem to be coming through to the sever but then they throw 500s.
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
java.lang.IllegalArgumentException: URI must not be null path:/my/uri
Yes I have both, and neither my @GetMapping nor my @PostMapping’s are working, all throw the above mentioned error. I ran through the basic tutorial and I was able to get that working.
Sadly I can not, as it’s not open source. I’m going to try starting from scratch again and hope that does it.
On a side note, would it make more sense to try and use a Web Application Type with an Authorization Code in Okta? We have several of those that are working, I just didn’t see anything on your site to get a React app working with the Web Application Type.
You could do this, and leverage cookies to talk to your Spring Boot application. We do this in JHipster. After you configured SSO on the Spring Boot side, you’d just need to hit http://localhost:8080/login from your React app to log in.
I figured it out, I needed a WebSecurityConfigurerAdapter for my routes/REST calls. Once that was configured, I was able to get a response from both POST and GET api calls.
figured I’d put what my solution was just incase anyone goes looking for it. It’s from the Spring website and is an angular example but the Spring Boot part stays the same.