yubrajpokharel/socialauth

LinkedIn Permissions issue

Closed this issue · 7 comments

Hi,

I am using SocialAuth 4.0 in my struts application.

I have to fetch all the linkedin data for a user.

My problem is i have set the permissions as Permissions.ALL in the initialized 
socialAuthManager but many a times it switch back to only Basic Profile.

the behaviour is lot random and i am not able to identify the actual reason 
behind it.

There was mentione like this in a different issue id=240. 

What shall i do. Please respond at earliest. I would appreciate any help.

Thank you

regards

Original issue reported on code.google.com by umang.ag...@joshworkz.com on 11 Mar 2013 at 6:58

Don't set any permission. By default it will ask the token for all permissions.

Goto your linkedin profile and delete the application from the following link.

https://www.linkedin.com/secure/settings?userAgree=&goback=.nas_*1_*1_*1

Try after that.


Regards
Tarun


Original comment by tarun.na...@3pillarglobal.com on 11 Mar 2013 at 9:03

Though i don't see a reason why the setting of permissions explicitly would be 
a problem anyways.

I did as was suggested. I removed the line which was setting permissions 
explicitly.
Also the authentication on linkedin was removed.

I tested my application and again the behaviour was random.

Attaching the screenshots. These are under the same flow and same code.

Original comment by umang.ag...@joshworkz.com on 11 Mar 2013 at 9:27

Attachments:

Please reply with the possible solution to the problem.

I did some digging myself. To what i understand is linkedin requires the 
permissions in scope parameter which is not supported in oAuth1 and since 
linkedinserviceimpl has oAuth1 as the authentication strategy the permission 
issue is seen.

Please let me know if there is any workaround to this as i would like to get 
all permissions for a user everytime and not this random permissions. 

Original comment by umang.ag...@joshworkz.com on 13 Mar 2013 at 5:33

Got your problem.

Please find the attach jar file and delete the application from the following 
link.

https://www.linkedin.com/secure/settings?userAgree=&goback=.nas_*1_*1_*1

Let me know if issue still exist.

Regards
Tarun

Original comment by tarun.na...@3pillarglobal.com on 13 Mar 2013 at 11:25

  • Changed state: Fixed

Attachments:

Hello, I had the same problem, but solved!

well, is necessary to modify this file:
src/org/brickred/socialauth/provider/LinkedInImpl.java

in method (public LinkedInImpl) you need modify the next code:
line 111:

String perms = getScope();
if (perms != null) {
   String rURL = ENDPOINTS.get(Constants.OAUTH_REQUEST_TOKEN_URL);
   rURL += "?scope=" + perms;
   ENDPOINTS.put(Constants.OAUTH_REQUEST_TOKEN_URL, rURL);
}

modify for:

String perms = getScope();
if (perms != null) {
  ENDPOINTS.remove(Constants.OAUTH_REQUEST_TOKEN_URL);
  ENDPOINTS.put(Constants.OAUTH_REQUEST_TOKEN_URL, "https://api.linkedin.com/uas/oauth/requestToken");
  String rURL = ENDPOINTS.get(Constants.OAUTH_REQUEST_TOKEN_URL);
  rURL += "?scope=" + perms;            
  ENDPOINTS.put(Constants.OAUTH_REQUEST_TOKEN_URL, rURL);
}

the problem ocurred because the variable "rURL" is incremented to "ENDPOINTS" 
and never was cleaned

In my case, I put the project out of the .jar!

Original comment by doug.tag...@gmail.com on 16 Apr 2013 at 12:43

Thanks for the insight.

For me the issue was resolved in the latest jar provided by them in the thread. 
I think they fixed it in version 4.0. 

Thank you

Original comment by umang.ag...@joshworkz.com on 16 Apr 2013 at 1:04

Code is committed in SVN. It will be available in new release as given in 
attach jar.

Original comment by tarun.na...@3pillarglobal.com on 18 Apr 2013 at 11:00