TheProjecter / socialauth

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

Errors occur with all providers, except Linkedin #318

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Please see the additional informations below.

What is the expected output? What do you see instead?
Below, the errors for each provider :
 - FACEBOOK
 url called : https://graph.facebook.com/oauth/authorize?client_id=152190004803645&response_type=code&redirect_uri=https%3A%2F%2Fmydomain.com%2Fcontextapp%2Fservices%2FsocialAuthResponse%3Fprovider%3Dfacebook%26fromURL%3Dhttps%253A%252F%252Fmydomain.com%252Fcontextapp%252Fmypage.html&scope=publish_stream,email,user_birthday,user_location,user_photos
 the output :
 {
   "error": {
      "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
      "type": "OAuthException",
      "code": 191
   }
 }

 - TWITTER
 Exception occurs when calling socialAuthManager.getAuthenticationUrl(providerId, callbackURL)
 org.brickred.socialauth.exception.SocialAuthException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at org.brickred.socialauth.util.HttpUtil.doHttpRequest(HttpUtil.java:220)
    at org.brickred.socialauth.util.OAuthConsumer.getRequestToken(OAuthConsumer.java:198)
    at org.brickred.socialauth.oauthstrategy.OAuth1.getLoginRedirectURL(OAuth1.java:69)
    at org.brickred.socialauth.provider.TwitterImpl.getLoginRedirectURL(TwitterImpl.java:161)
    at org.brickred.socialauth.SocialAuthManager.getAuthURL(SocialAuthManager.java:162)
    at org.brickred.socialauth.SocialAuthManager.getAuthenticationUrl(SocialAuthManager.java:116)
 ...
 Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1764)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1206)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136)
 ...
 Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
    at sun.security.validator.Validator.validate(Validator.java:218)
 ...
 Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)

 - GOOGLE / GOOGLE+
 url called : https://www.google.com/accounts/o8/ud?openid.assoc_handle=1.AMlYA9U37rLo0AOOLhelA3g0syh8-HC8mRwNrtr2FjbrgeO6vj6P24uE2OT9aA&openid.ax.mode=fetch_request&openid.ax.required=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%2Fpref%2Flanguage&openid.ax.type.lastname=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ext2.consumer=recette.net-ful.com&openid.ext2.scope=https%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_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%2Foauth%2F1.0&openid.ns.max_auth_age=0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.realm=https%3A%2F%2Fmydomain.com&openid.return_to=https%3A%2F%2Fmydomain.com%2Fcontextapp%2Fservices%2FsocialAuthResponse%3Fprovider%3Dgoogle%26fromURL%3Dhttps%253A%252F%252Fmydomain.com%252Fcontextapp%252Fmypage.html
 The Google loggin page is displayed (but without message that indicates an external application would like to access user info, is it normal ?).
 After logged in, redirecting to my callback servlet but an exception occurs when calling socialAuthManager.connect(SocialAuthUtil.getRequestParametersMap(request)) :

 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:178)
    at org.brickred.socialauth.provider.GoogleImpl.verifyResponse(GoogleImpl.java:167)
    at org.brickred.socialauth.SocialAuthManager.connect(SocialAuthManager.java:184)
 ...

 - LINKEDIN
 But with LinkedIn, I have no problem. The LinkedIn connection page is correctly displayed with a message "SocialAuth would like to access some of your LinkedIn info".
 And when logged in, my page is updated with the user profile informations.

What version of the product are you using? On what operating system?
SocialAuth 4.3
Environment : Spring 2, JSF 1 on Glassfish 2 app server
Windows 7 pro.

Please provide any additional information below.
The calling sequence that I implemented (I was inspired in the example for 
Spring3) :
First, when user click on provider icon :
 - create callback url
 - call socialAuthManager.getAuthenticationUrl(providerId, callbackURL)
 - redirect with the returned url
When user has logged on :
 - a servlet is called (set in the callback url)
 - call socialAuthManager.connect(SocialAuthUtil.getRequestParametersMap(request)) to retrieve the AuthProvider
 - call provider.getUserProfile()
 - update my user form with the user profile informations
 - redirect to my page to display the informations

Is this sequence correct ?

Can you help me to correct these problems.
Thanks

Regards !

Original issue reported on code.google.com by netfulsh...@gmail.com on 9 Jan 2014 at 9:40

GoogleCodeExporter commented 9 years ago
For Facebook and other providers too please make sure that you are using the 
same domain and return URL what you are entering while registering your 
application on that provider.

As per your error log the redirect uri is 
https://mydomain.com/contextapp/services/socialAuthResponse?provider=facebook&fr
omURL=.... (something like that)
Please make sure you have given the same redirect URI while registering your 
application on socialauth.

Please read comment #2 on following URL for google+
http://code.google.com/p/socialauth/issues/detail?id=298

Original comment by tarun.na...@3pillarglobal.com on 10 Jan 2014 at 4:25

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for your quick reply.

Please can you tel me how to register the providers (or links that explain).
I try it for Facebook, but it does not accept my domain (by creating a 
developer account, but maybe I'm wrong).

But on LinkedIn, it works fine but I did not need to register my application.
Is it different for this provider ?

Thanks.

Original comment by netfulsh...@gmail.com on 13 Jan 2014 at 11:41

GoogleCodeExporter commented 9 years ago
Please have a look into the following URL

https://github.com/3pillarlabs/socialauth-android/wiki/Guide-Facebook

Original comment by tarun.na...@3pillarglobal.com on 17 Jan 2014 at 5:12

GoogleCodeExporter commented 9 years ago

Original comment by tarun.na...@3pillarglobal.com on 24 Jan 2014 at 12:28