spring-projects / spring-security-samples

1.45k stars 703 forks source link

Problems with SAML2 samples #81

Open onmishkin opened 2 years ago

onmishkin commented 2 years ago

I'm having problems trying to run these two SAML2 samples:

The Gradle command line in the READMEs doesn't work. I figured out what I think are the right tasks to invoke:

For the first sample, Tomcat seems to come up but the webapp doesn't seem to be loaded. Going to http://localhost:8080 produces a generic Tomcat 404 page.

For the second sample, Tomcat and the webapp do come up. I'd like to be able to attach a debugger to it though and there doesn't seem to be a simple way to do that. (For the first sample, if it worked, I think I could use the ...:appStartDebug task to make it debuggable.)

marcusdacoregio commented 2 years ago

Hi @onmishkin, thanks for the report. I'm figuring out what is happening with those samples in the main branch. Instead of using the main branch, you could checkout the 5.7.x branch and run the sample there, the main branch is used for Spring Security 6 which is not released yet, so things are not so reliable.

I ran those two commands in 5.7.x and they are working fine. Please let us know if it does not work for you.

onmishkin commented 2 years ago

Hi @marcusdacoregio, thanks for the response. After I opened this issue I in fact took a guess that the use of Spring 6 was at least a contributing factor and checked out the 5.7.x branch too and made progress. The Gradle task names in the READMEs are wrong even on that branch though.

Semi-relatedly, when I imported the samples project into Eclipse (using Buildship, the Gradle import plugin for Eclipse) I was left with an Eclipse setup with tons of (>1000) compilation errors because, AFAICT, the constructed Eclipse projects are just completely messed up (e.g., don't have the Java "nature"). I use Eclipse and Buildship for my own projects so I'm very familiar with them but I haven't yet tried to figure out why they're blowing up so badly with these samples projects. What tooling do the sample creators or maintainers use to work on the samples?

marcusdacoregio commented 2 years ago

We mostly use IntelliJ IDEA to work on the samples. I'll bring your observations to the team's attention and see what could be done from our side to help with the project structure in different IDEs.