yubrajpokharel/socialauth

Error 400 on Facebook's authentication

Closed this issue · 8 comments

I'm trying to obtain the user's profile but an excecption appears when I call 
the method SocialAuthManager.conect or SocialAuthManager.accessGrant. The 
Tomcat log is attached.
I'm following the wiki page GettingStartedWithYourOwnFramework.


What steps will reproduce the problem?
1. Instance of SocialAuthConfig is created.
2. User authentication have been made.
3. Can't get the user's profile because the Profile class is not instantiated 
and the error 400 come first. 

What is the expected output? What do you see instead?
The user's profile information.
I get the 400 error code.

What version of the product are you using? On what operating system?
SocialAuth 4.3 on windows.

Please provide any additional information below.
Netbeans 7.4
JSF + Primefaces.
It's just to learn how Facebook's login authentication works in Java SocialAuth.

Original issue reported on code.google.com by edu.li...@gmail.com on 21 Jan 2014 at 2:31

Attachments:

Please use the same redirectURL which you are using while register your 
application on facebook.

redirect_uri should be 
http://encontreventos.com/EncontreventosWebApp/sucesso.jsf while registering 
your application on FB.

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

Yeah, I registered this URL on my facebook web app and the error still occurs. 
The exacly point when the IOException is thrown, on the OAuth2.verifyResponse I 
follow the LOG.debug messages and I don't know why this IOException is thrown. 
On the source code there's a try..except block that throws this exception but 
makes nonsense because before the next message from LOG.debug it would be this 
one "LOG.debug("Verification Code : " + code);" and it seems that exception 
happens earlier.

So, any idea?

Original comment by edu.li...@gmail.com on 24 Jan 2014 at 1:25

Here the source-code where I'm using the SocialAuth library: 
https://code.google.com/p/login-social-auth/source/browse/

Note: See UserBeanSession.java.

Original comment by edu.li...@gmail.com on 24 Jan 2014 at 2:12

More information:

I followed this guide: 
http://mrj4mes.blogspot.com.br/2013/03/how-to-implement-facebook-login-in-jsf.ht
ml . 

In UserBeanSession.pullUserInfo() you have to ignore some codes there. The 
important line to see is the manager.createAccessGrant, where I have the 
provider ID, the authorization code and the redirectURL. I guess this 
parameters should satisfy this method.

Original comment by edu.li...@gmail.com on 24 Jan 2014 at 2:27

Oops, I see that there is two methods LOG.debug and LOG.info(). Forget the 
second comment when I said about this.

Original comment by edu.li...@gmail.com on 24 Jan 2014 at 2:35

Could someone tell me why a IOException is possible to be thrown on the method 
OAuth2.VerifyResponse when the 
"response.getResponseBodyAsString(Constants.ENCODING)" is called? I believe 
this is the problem of this issue. 

Original comment by edu.li...@gmail.com on 30 Jan 2014 at 12:09

Scribe works!

Original comment by edu.li...@gmail.com on 4 Feb 2014 at 7:26

Original comment by tarunnag...@gmail.com on 31 Oct 2014 at 1:33

  • Changed state: Done