yubrajpokharel/socialauth

SocialAuth not working with Twitter, Yahoo

Closed this issue · 6 comments

Hi.
Im trying to use SocialAuth without success for few days.

What steps will reproduce the problem?
1. Using your demo http://labs.3pillarglobal.com/socialauthdemo/registration.do 
as well as my own.
2. Try to authenticate using Twitter or Yahoo.

What is the expected output? What do you see instead?
For twitter, exception say can't retrieve access token even though call back 
url have oauth_token and oauth_verifier.
For Yahoo, exception with server running application should be the same that 
was registered to get key

What version of the product are you using? On what operating system?
Using newest version 4.5. Running on a Tomcat 7.0.34

Please provide any additional information below.
Im running on localhost but did do as 
https://code.google.com/p/socialauth/wiki/HowToRunApplicationWithLocalhostOnWind
ows to change domain name. Verify that it work.

Original issue reported on code.google.com by unli...@gmail.com on 14 Apr 2014 at 3:11

It is working fine at our end.
We have to change our demo with new version 4.5.

Please make sure you are using 4.5 version and opensource.brickred,com keys.

If you are still facing the issue please attach log details.

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

I'm using ver 4.5 and i didn't change keys for twitter.
After redirect to twitter login page, login success, when redirect back, i got 
oauth_token and oauth_verifier parameter.
Here is the code to get i use:

SocialAuthManager manager = (SocialAuthManager) 
request.getSession().getAttribute("authManager");
Map<String, String> singleInstanceParams = 
SocialAuthUtil.getRequestParametersMap(request);

Profile p = null;
try {
    AuthProvider provider = manager.connect(singleInstanceParams);
    p = provider.verifyResponse(singleInstanceParams);
    validatedId = provider.getUserProfile().getValidatedId();
} catch (Exception e) {
    e.printStackTrace();
}

This code working fine for google atleast. But with twitter, here is the error 
log.
Could you tell me which is wrong here ?

Thank you

Original comment by unli...@gmail.com on 5 May 2014 at 2:41

Attachments:

Just do following

Profile p = null;
try {
    AuthProvider provider = manager.connect(singleInstanceParams);

    validatedId = provider.getUserProfile().getValidatedId();
} catch (Exception e) {
    e.printStackTrace();
}

Original comment by tarun.na...@3pillarglobal.com on 15 May 2014 at 4:27

Erh you only delete the line code which use to get profile?
Well since Twitter didn't response with profile info, i think that line won't 
work anyway. But then for Twitter, how to get profile info using SocialAuth ?
Normally i would need to send another request to get profile info using the 
token i get from the first response right ?

Original comment by mame...@gmail.com on 23 May 2014 at 8:45

Following should work for getting profile but I am assuming you have done the 
first step of authentication.

Profile p = null;
try {
    AuthProvider provider = manager.connect(singleInstanceParams);

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

Original comment by tarun.na...@3pillarglobal.com on 5 Jun 2014 at 1:50

Please open a new one if you are still facing the issue.

Original comment by tarun.na...@3pillarglobal.com on 2 Jul 2014 at 8:02

  • Changed state: Done