Closed jmussman closed 2 years ago
I had no dependency issues when I first created it. Did you follow the tutorial or clone this repo and try to set it up?
Hi Matt,
I started out with your blog post: https://developer.okta.com/blog/2022/08/05/spring-boot-saml. Then I went to the repo.
Then I just cloned the repo and loaded it into intellij. I pegged the project (and Gradle) to Java 17 and stumbled into IntelliJ wouldn’t load org.thymeleaf.extras:thymeleaf-extras-springsecurity6 until I pegged it to the release candidate. I got things working, but then that module wasn’t working because it turns out that Spring Security 5 is what actually got loaded by Intellij when its Gradle ran.
The thing is I wanted to play around with it in Intellij because I was trying to figure out some behavior of Spring Boot Saml2. So I didn’t strictly follow your instructions of running Gradle from the command line 😊
I could have screwed up somewhere along the way, I’ve been known to do that.
Edit: I should add that since I don't know exactly what versions of the dependencies it's looking for, having them declared would make sure the right ones load in all cases, no?
Joel
I just cloned this repo and ran ./gradlew bootRun
. It fails to compile, so something has changed:
➜ okta-spring-boot-saml-example git:(main) ./gradlew bootRun
> Task :compileJava
/Users/mraible/dev/okta/okta-spring-boot-saml-example/src/main/java/com/example/demo/SecurityConfiguration.java:34: error: cannot find symbol
.mvcMatchers("/favicon.ico").permitAll()
^
symbol: method mvcMatchers(String)
location: variable authorize of type AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry
1 error
> Task :compileJava FAILED
As far as the dependency versions, those are controlled by Spring Boot using these two plugins:
id 'org.springframework.boot' version '3.0.0-SNAPSHOT'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
@jmussman I just fixed this issue in https://github.com/oktadev/okta-spring-boot-saml-example/pull/23. Since it's merged, you should be able to update the main
branch, or re-clone this repo.
Ha, I just pulled it and ran it against my tenant joelmussmanoie001.oktapreview.com and it ran fine. I'm going to try it in Idea now and see if it works in the IDE.
Works for me in IntelliJ.
Beautiful! It worked for me too, once I set the JDK for Gradle from 11 to 17 :) I think it will be appreciated by folks I point toward this example.
Regardless of this it did help even before this because it allowed me to work out some things that aren't explained so clearly in the Spring SAML2 documentation. And that allowed me to finish a new multi-client/IdP, single-tenant application we needed for a new training environment. So I thank you!
I'm glad to hear you got it working. 😊
Hi, it took me a bit of juggling to get the dependency versions set so it would actually come together when I tried to spin this up in Intellij. And, I don't think I have what you're releasing it with, because I had to back down to thymeleaf-extras-springsecurity5. Would you mind adding specific versions to the dependencies in build.gradle so it puts it together the way that you intended?
TY