Closed GoogleCodeExporter closed 8 years ago
Note: The API key and secret are definitely working because I get to the
Google/Twitter Login page and I see my app name in there.
Just seems like there is some sort of bug in the code that injects the
SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
AuthProvider provider = manager.getCurrentAuthProvider();
Profile profile = provider.getUserProfile();
Profile will be NULL.
Original comment by nicholas...@gmail.com
on 29 Sep 2012 at 6:46
The LoginRedirectURL =
https://www.google.com/accounts/o8/ud?openid.assoc_handle=AMlYA9XSiPzr36XuazJjRr
B6JhX1cx1AIfPzqI6bTs94gBwKC4hzKQdT&openid.ax.mode=fetch_request&openid.ax.requir
ed=country%2Cemail%2Cfirstname%2Clanguage%2Clastname&openid.ax.type.country=http
%3A%2F%2Faxschema.org%2Fcontact%2Fcountry%2Fhome&openid.ax.type.email=http%3A%2F
%2Faxschema.org%2Fcontact%2Femail&openid.ax.type.firstname=http%3A%2F%2Faxschema
.org%2FnamePerson%2Ffirst&openid.ax.type.language=http%3A%2F%2Faxschema.org%2Fpr
ef%2Flanguage&openid.ax.type.lastname=http%3A%2F%2Faxschema.org%2FnamePerson%2Fl
ast&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_se
lect&openid.ext2.consumer=localhost&openid.ext2.scope=http%3A%2F%2Fwww.google.co
m%2Fm8%2Ffeeds%2F&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fi
dentifier_select&openid.mode=checkid_setup&openid.ns.ax=http%3A%2F%2Fopenid.net%
2Fsrv%2Fax%2F1.0&openid.ns.ext2=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Foau
th%2F1.0&openid.ns.max_auth_age=0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2
Fextensions%2Fpape%2F1.0&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&op
enid.realm=http%3A%2F%2Flocalhost%3A8080&openid.return_to=http%3A%2F%2Flocalhost
%3A8080%2Ftestapp-oauth%2Fsocialauth.do
org.brickred.socialauth.util.OAuthConfig Object {
consumerKey: xxxxxxxxxxxxx.apps.googleusercontent.com
consumerSecret: xxxxxxxxxxxxxxxxxxxxxxxx
signatureMethod: HMAC-SHA1
transportName: GET
id: google
providerImplClass: class org.brickred.socialauth.provider.GoogleImpl
customPermissions: null
}
verifyResponse's request params:
{openid.op_endpoint=https://www.google.com/accounts/o8/ud,
openid.signed=op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_han
dle,ns.ext1,ext1.mode,ext1.type.firstname,ext1.value.firstname,ext1.type.email,e
xt1.value.email,ext1.type.language,ext1.value.language,ext1.type.lastname,ext1.v
alue.lastname,ext1.type.country,ext1.value.country,
openid.ns.ext1=http://openid.net/srv/ax/1.0,
openid.sig=EcRz8elVXs0DIZyv5L/8bAsWo3E=, openid.ext1.value.country=US,
openid.response_nonce=2012-09-29T16:46:29Zd3SXvBjFdPy_Yw,
openid.claimed_id=https://www.google.com/accounts/o8/id?id=AItOawn3McmfFzRdc8xBE
1x5IHgArAZJUz1oNGs, openid.ext1.value.lastname=DiPiazza,
openid.assoc_handle=AMlYA9XSiPzr36XuazJjRrB6JhX1cx1AIfPzqI6bTs94gBwKC4hzKQdT,
openid.ext1.value.firstname=Nicholas,
openid.ext1.value.email=nicholas.dipiazza@gmail.com,
openid.ext1.type.language=http://axschema.org/pref/language,
openid.ext1.type.lastname=http://axschema.org/namePerson/last,
openid.ext1.type.firstname=http://axschema.org/namePerson/first,
openid.ns=http://specs.openid.net/auth/2.0,
openid.identity=https://www.google.com/accounts/o8/id?id=AItOawn3McmfFzRdc8xBE1x
5IHgArAZJUz1oNGs, openid.ext1.type.email=http://axschema.org/contact/email,
openid.ext1.mode=fetch_response, openid.mode=id_res,
openid.ext1.value.language=en,
openid.ext1.type.country=http://axschema.org/contact/country/home,
openid.return_to=http://localhost:8080/myapp-oauth/socialauth.do}
Original comment by nicholas...@gmail.com
on 29 Sep 2012 at 5:33
[deleted comment]
Found a work around - When you are using a auth provider that uses the
org.brickred.socialauth.oauthstrategy.Hybrid class, you cannot have permission
= Permission.ALL.
Setting to Permission.AUTHENTICATE_ONLY makes it work.
Seems like the Profile isn't lacking anything even though
Permission.AUTHENTICATE_ONLY had been set. So this is good enough for me.
Original comment by nicholas...@gmail.com
on 29 Sep 2012 at 5:59
Its not like that.
You are running your application from localhost and trying yo get Contacts. But
localhost doesn't have this permission that's why when you change the
permission for AUTHENTICATE_ONLY, it doesn't make a request for getting
contacts and it runs fine.
If you still want to run your application from localhost, please have a look
into the following URL:-
http://code.google.com/p/socialauth/wiki/HowToRunApplicationWithLocalhostOnWindo
ws
Regards
Tarun
Original comment by tar...@brickred.com
on 3 Oct 2012 at 8:24
I am trying to import the contacts using spring-boot and socialAuth
I had written following snippet
SocialAuthConfig :
------------------------------------------------
@Configuration
@EnableAutoConfiguration
public class SpringSocialConfig {
@Bean
public SocialAuthConfig socialAuthConfig() throws Exception {
SocialAuthConfig config = SocialAuthConfig.getDefault();
Properties socialAuthProperties = new Properties();
// g+
socialAuthProperties.setProperty("www.google.com.consumer_key","AIzaSyB1WN0M4PjdsvZySoIeD0SYIeBiiqmjyDQ");
socialAuthProperties.setProperty("www.google.com.consumer_secret","gaHYBT8X-XP86V2Buv6R4FWC");
// 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
public SocialAuthManager socialAuthManager() throws Exception {
SocialAuthManager manager = new SocialAuthManager();
manager.setSocialAuthConfig(socialAuthConfig());
return manager;
}
@Bean
public SocialAuthTemplate socialAuthTemplate() throws Exception {
SocialAuthTemplate socialAuthTemplate = new SocialAuthTemplate();
return socialAuthTemplate;
}
@Bean
public SocialAuthWebController socialAuthWebController(){
SocialAuthWebController socialAuthWebController = new SocialAuthWebController("http://localhost:8080/","socialauth","error/error_default");
return socialAuthWebController;
}
In View Page:
--------------------------
<a href="socialauth?id=facebook"><img src="images/facebook_icon.png" alt="Facebook" title="Facebook" border="0"/></a>
I am getting Exception like
---------------------------------------------------
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.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)
Can Anybody suggest me what i did the mistake in config or else i need to add
some extra code
Thanks In advance
Original comment by mungarar...@gmail.com
on 27 Feb 2015 at 2:58
Original issue reported on code.google.com by
nicholas...@gmail.com
on 29 Sep 2012 at 6:42