TheProjecter / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 1 forks source link

I am not able to get the provider instance after sucessfully authentication #382

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.In My SocialAuthConfig Class i written following 
--------------------------------------------------------------------

@Configuration
@EnableAutoConfiguration
public class SpringSocialConfig {

    @Autowired
    public SocialAuthConfig config;

    @Autowired
    public SocialAuthManager manager;

    @Autowired
    public SocialAuthTemplate socialAuthTemplate;

    @Autowired
    public SocialAuthWebController socialAuthWebController;

    @Bean
    public SocialAuthConfig socialAuthConfig() throws Exception {
        config = SocialAuthConfig.getDefault();
        Properties socialAuthProperties = new Properties();
//      g+
        socialAuthProperties.setProperty("www.google.com.consumer_key","AIzaSyB1WN0M4PjdsvZySoIeD0SYIeBiiqmjyDQ");
        socialAuthProperties.setProperty("www.google.com.consumer_secret","JFZuw1zZL70V8CKTPW8l78J8");
//        Yahoo
        socialAuthProperties.setProperty("api.login.yahoo.com.consumer_key","dj0yJmk9eDA4ZGo5UXl4b2FLJmQ9WVdrOWNWZ3plVlZITmpJbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1hYg--");
        socialAuthProperties.setProperty("api.login.yahoo.com.consumer_secret","5f62ac135cb9e9d986ec1d72e42502af43a740f5");
//        twitter
        socialAuthProperties.setProperty("twitter.com.consumer_key","LHjSYouR0yDZx607hNJ6dXSen");
        socialAuthProperties.setProperty("twitter.com.consumer_secret","7Wt21xWCZASEVCokvMx2vBKL9Haca9xIDMZ8Rinqbxrs01vZdg");
//        facebook
        socialAuthProperties.setProperty("graph.facebook.com.consumer_key","184566081734140");
        socialAuthProperties.setProperty("graph.facebook.com.consumer_secret","e6d3929a575d37b3eac4c083454d143d");
//        hotmail
        socialAuthProperties.setProperty("consent.live.com.consumer_key","0000000040145B73");
        socialAuthProperties.setProperty("consent.live.com.consumer_secret","FAmFXKVFO1GnPrXD2epd52VElkHcKjWA");
        config.setApplicationProperties(socialAuthProperties);
        return config;
    }

    @Bean
    @Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
    public SocialAuthManager socialAuthManager() throws Exception {
        manager = new SocialAuthManager();
        manager.setSocialAuthConfig(socialAuthConfig());
        return manager;
    }

    @Bean
    @Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
    public SocialAuthTemplate socialAuthTemplate() throws Exception {
        socialAuthTemplate = new SocialAuthTemplate();
        return socialAuthTemplate;
    }

    @Bean
    public SocialAuthWebController socialAuthWebController(){
        socialAuthWebController = new SocialAuthWebController("http://localhost:8080/","authSuccess","error/error_default");
        return socialAuthWebController;
    }

2. In View Page:
--------------------------------------------

<td>
                                <a href="socialauth?id=facebook"><img src="images/facebook_icon.png" alt="Facebook" title="Facebook" border="0"/></a>
                            </td>

3. In My Controller:
--------------------------------------------------

 @RequestMapping(value = "/authSuccess")
    public ModelAndView importSocialContacts(Model model,HttpServletRequest request) {

        SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();

        try {
            AuthProvider provider = manager.getCurrentAuthProvider();

            provider.getContactList();
            provider.getUserProfile();
        } catch (Exception e) {
            e.printStackTrace();
        }

       return new ModelAndView("myfoodee/success");
    }

What is the expected output? What do you see instead?

Instead of succes Page 

I am getting following Issue,

org.brickred.socialauth.exception.SocialAuthException: Key in Request Token is 
null or blank
    at org.brickred.socialauth.util.OAuthConsumer.getAccessToken(OAuthConsumer.java:231)
    at org.brickred.socialauth.oauthstrategy.Hybrid.verifyResponse(Hybrid.java:138)
    at org.brickred.socialauth.oauthstrategy.Hybrid.verifyResponse(Hybrid.java:115)
    at org.brickred.socialauth.provider.GoogleImpl.doVerifyResponse(GoogleImpl.java:158)
    at org.brickred.socialauth.provider.GoogleImpl.verifyResponse(GoogleImpl.java:147)
    at org.brickred.socialauth.SocialAuthManager.connect(SocialAuthManager.java:183)
    at org.brickred.socialauth.SocialAuthManager$$FastClassBySpringCGLIB$$1e842cf3.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:711)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)
    at org.brickred.socialauth.SocialAuthManager$$EnhancerBySpringCGLIB$$f866015c.connect(<generated>)
    at org.brickred.socialauth.spring.controller.SocialAuthWebController.callback(SocialAuthWebController.java:145)
    at org.brickred.socialauth.spring.controller.SocialAuthWebController.openidCallback(SocialAuthWebController.java:137)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:85)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.foodeebuddee.configs.FBCORSFilter.doFilter(FBCORSFilter.java:23)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

What version of the product are you using? On what operating system?

spring4.0, socialAuth4.0 and windows7

Please provide any additional information below.

Original issue reported on code.google.com by mungarar...@gmail.com on 28 Feb 2015 at 11:28