spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.
http://projects.spring.io/spring-social
Apache License 2.0
619 stars 351 forks source link

SpringSocialConfigurer with jdk 8 #134

Closed miosman closed 10 years ago

miosman commented 10 years ago

Using spring-social-config to configure sign-in with provider lead to compilation error if the project is configured with bytecode level 1.8. Code snippet below

@Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .formLogin()
                .loginPage("/signin")
                .loginProcessingUrl("/signin/authenticate")
                .failureUrl("/signin?param.error=bad_credentials")
                .and()
                .logout()
                .logoutUrl("/signout")
                .deleteCookies("JSESSIONID")
                .and()
                .authorizeRequests()
                .antMatchers("/admin/**", "/favicon.ico","/signin/**").permitAll()
                .antMatchers("/**").authenticated()
                .and()
                .rememberMe()
                .and()
                .apply(new SpringSocialConfigurer());
    }

When compiling the previous code with bytecode level 1.8. The compiler gives an 'ambiguous method call ' error on the AbstractConfiguredSecurityBuilder.apply method.

I am using spring-boot 1.0.2.RELEASE with spring-secuirty 3.2.3.RELEASE and spring-social 1.1.0.RELEASE.

trautonen commented 10 years ago

I have bumped into the same issue. I even wonder why the apply method is implemented with overloading because the signature parameters are interface and implementation of the same interface. A simple fix should be to remove the implementation parameter method and use instanceof in the other method to handle the concrete implementation details.

cemo commented 10 years ago

I don't have compile time error but IDEA shows an error. It seems that it is relevant to IDEA. Are you using IDEA too?

trautonen commented 10 years ago

Yea, forgot to mention that this indeed seems an Idea issue because the JDK compiler runs the code fine. (Or maybe Idea implementation is strict and JDK compiler is lenient)

miosman commented 10 years ago

Yep me too the error was shown in IDEA. Seems to be an IDEA issue. Closing the issue.