jeffwils / grails-spring-security-saml

Grails Spring Security SAML2.0 Plugin for Grails 3
8 stars 24 forks source link

Package versions problems #8

Closed dzikiplankton closed 6 years ago

dzikiplankton commented 7 years ago

Can you please share exact versions of your build. I would appreciate results of gradle dependencies command on your working setup.

The examples from documentation are failing for me. For both versions.

First there is method in metadata controller call that is not supported in new spring sec core so I have to add this to build.gradle.

configurations.all { resolutionStrategy { eachDependency { DependencyResolveDetails details -> if (details.requested.group == 'org.springframework.security.extensions' && details.requested.name == 'spring-security-saml2-core') { details.useVersion "1.0.0.RC2" } } } }

After that I had to remove defaultIDP setting.

Now I'm seeing this one

type Exception report

message Filter execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:75) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) root cause

java.lang.NoSuchMethodError: org.springframework.security.saml.SAMLProcessingFilter.getFilterProcessesUrl()Ljava/lang/String; org.springframework.security.saml.SAMLProcessingFilter.requiresAuthentication(SAMLProcessingFilter.java:109) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:204) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.springframework.security.saml.metadata.MetadataDisplayFilter.doFilter(MetadataDisplayFilter.java:83) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.springframework.security.saml.SAMLEntryPoint.doFilter(SAMLEntryPoint.java:102) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:75) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

dzikiplankton commented 7 years ago

I would really appreciate working example (with metadata generator).

jeffwils commented 7 years ago

What grails version are you using. I have had similar issues with 3.2

dzikiplankton commented 7 years ago

Hi,

I'm using. 3.1.9 but when I have tried to set up this plugin with 3.0 problems were similar.

Please kindly share working build insights :) then I will be able to enforce versions that are downloaded by your gradle.

Thanks!

26 lip 2017 05:34 "jeffwils" notifications@github.com napisał(a):

What grails version are you using. I have had similar issues with 3.2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeffwils/grails-spring-security-saml/issues/8#issuecomment-317937852, or mute the thread https://github.com/notifications/unsubscribe-auth/AJpHMx12hWIMr9I_yAf4eOq4kPGUQZtYks5sRrPGgaJpZM4OgjpN .

dzikiplankton commented 7 years ago

I suppose some of dependencies have entered new version and methods are not available.

Easiest way to check that would be comparing dependencies of working version with actual one. Sadly I failed to run this plugin (including clear build with example configuration).

I was trying to find some compatible versions of dependencies (spring sec core, grails spring sec ....) but I failed :(

jeffwils commented 7 years ago

I just uploaded a sample app at https://github.com/jeffwils/saml-plugin-test Try cloning it and running it. I built it with 3.1.9 and I can get it to start up and it downloads the metadata by going to localhost:8080/saml/metadata. This app has a viable build.gradle and an application.yml file that is configured to the sample keystore, sp and idp files in the grails-app/conf/security directory. The idp is bogus, but it if you click on the MetadataController on the home page it will invoke the idp but not find it since it expects an IDP running on localhost:9031

jeffwils commented 7 years ago

I have also attached the Gradle Dependency Report

Gradle-Dependency-Report.txt

dzikiplankton commented 7 years ago

Hi I was not specific enough. Your example works same as my build. It fails when I'm trying to generate new sp metadata :(

"" image

Do you advice to generate metadata with some other tool like this ?? https://www.samltool.com/sp_metadata.php

dzikiplankton commented 7 years ago

I have one additional question:

In the test you published I can see that you have controllerAnnotations configured in both application.groovy and application.yml

Is this necessary ?

jeffwils commented 7 years ago

No, I just forgot to remove the application.groovy. Its an artifact of running the s2-quickstart.

Now regarding the error. Now I see what you are trying to do. That screen shot was a big help. That more than likely a legit bug from the conversion of the plugin from 2.5 to 3. Let me dig in and I will get that fixed. In the mean time, yes, using a tool like that to generate metadata is fine. In practice I usually generate my own which is why I haven't come across this issue.

dzikiplankton commented 7 years ago

Thanks !! Saved my day :D or week to be honest :P

irstevenson commented 6 years ago

Looks like @dzikiplankton was all sorted in the end, so closing issue. Can re-open if I'm wrong.