Open GoogleCodeExporter opened 8 years ago
I am also getting the error message "Access to network denied" and "Access to
people search denied".
How to set the scope in the request token URL to solve this problem?
Original comment by goel.anu...@gmail.com
on 11 Sep 2012 at 1:12
I proposed these two changes to the implementation to solve the problems
encountered with scope...
1.
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- <html>LinkedInOAuthService.java (Today 18.48.21)</html>
+++ <html>LinkedInOAuthService.java (Today 18.54.32)</html>
@@ -51,6 +51,15 @@
*
* @return the o auth access token
*/
+ public LinkedInAccessToken getOAuthAccessToken(LinkedInRequestToken
requestToken, String scope, String oauthVerifier);
+ /**
+ * Gets the o auth access token.
+ *
+ * @param requestToken the request token
+ * @param oauthVerifier the oauthVerifier
+ *
+ * @return the o auth access token
+ */
public LinkedInAccessToken getOAuthAccessToken(LinkedInRequestToken requestToken, String oauthVerifier);
/**
2.
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- <html>LinkedInOAuthServiceImpl.java (Today 18.48.21)</html>
+++ <html>LinkedInOAuthServiceImpl.java (Today 18.59.30)</html>
@@ -115,12 +115,20 @@
*/
@Override
public LinkedInAccessToken getOAuthAccessToken(LinkedInRequestToken requestToken, String oauthVerifier) {
+ return(getOAuthAccessToken(requestToken, null, oauthVerifier));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public LinkedInAccessToken getOAuthAccessToken(LinkedInRequestToken
requestToken, String scope, String oauthVerifier) {
if (requestToken == null) {
throw new IllegalArgumentException("request token cannot be null.");
}
try {
final OAuthConsumer consumer = getOAuthConsumer();
- final OAuthProvider provider = getOAuthProvider();
+ final OAuthProvider provider = getOAuthProvider(scope);
consumer.setTokenWithSecret(requestToken.getToken(), requestToken.getTokenSecret());
provider.retrieveAccessToken(consumer, oauthVerifier);
@@ -227,7 +235,13 @@
*
*/
protected OAuthProvider getOAuthProvider() {
- DefaultOAuthProvider provider = new
DefaultOAuthProvider(LinkedInApiUrls.LINKED_IN_OAUTH_REQUEST_TOKEN_URL,
+ return(getOAuthProvider(null));
+ }
+ /**
+ *
+ */
+ protected OAuthProvider getOAuthProvider(String scope) {
+ DefaultOAuthProvider provider = new
DefaultOAuthProvider(LinkedInApiUrls.LINKED_IN_OAUTH_REQUEST_TOKEN_URL+(scope!=n
ull)?"?scope="+scope.replace(' ', '+'):"",
LinkedInApiUrls.LINKED_IN_OAUTH_ACCESS_TOKEN_URL, LinkedInApiUrls.LINKED_IN_OAUTH_AUTHORIZE_URL);
provider.setOAuth10a(OAUTH_VERSION_1_0_a.equals(ApplicationConstants.OAUTH_VERSION));
Then use instead of simply:
LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(linkedInApiKey, linkedInSecretKey)
LinkedInRequestToken requestToken = oauthService.getOAuthRequestToken(callbackUrl);
LinkedInOAuthServiceFactory.getInstance().createLinkedInOAuthService(linkedInApiKey, linkedInSecretKey)
LinkedInRequestToken requestToken = oauthService.getOAuthRequestToken(callbackUrl, scope);
The scope is defined with a string like (See
http://oodlestechnologies.com/blogs/Recent-changes-in-LinkedIn-API for more
info)
scope = "r_fullprofile r_network";
Hopes it helps
Thierry Bodhuin
Original comment by bodh...@gmail.com
on 15 Sep 2012 at 5:12
please resolve this m waiting for this
Original comment by deepakch...@gmail.com
on 28 Sep 2012 at 10:46
I've solved this issue before couple of weeks. Sorry for my late response. I've
posted my answer at here.
http://stackoverflow.com/questions/12188341/cant-post-anything-on-linkedin-using
-linkedin-j/12565935#12565935
Thanks
Original comment by ngmm...@gmail.com
on 28 Sep 2012 at 2:17
Hi Thanks for reply, it would be appreciated if you provide one method to
set request parameter in linkedin-j. Your lib very good m looking for some
positive response.
Original comment by deepakch...@gmail.com
on 29 Sep 2012 at 12:56
Another patch you can do without compile the code is to change the final field
via reflection, here is the example:
java.lang.reflect.Field field = LinkedInApiUrls.class.getField("LINKED_IN_OAUTH_REQUEST_TOKEN_URL");
field.setAccessible(true);
java.lang.reflect.Field modifiersField = java.lang.reflect.Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(null, LinkedInApiUrls.LINKED_IN_OAUTH_REQUEST_TOKEN_URL + "?scope=r_basicprofile+r_emailaddress");
Original comment by cont...@donanza.com
on 25 Apr 2013 at 9:56
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>403</status>
<timestamp>1369385621393</timestamp>
<request-id>79TGO06QXQ</request-id>
<error-code>0</error-code>
<message>Access to people search denied.</message>
</error>
I get this results when I try to access the people search using REST apis in
Client REST Simple, so how do we solve this error , all the apis work for
example jobs and companies api works perfectly for me but This doesnt work can
anyone provide me the solution and suggestion on this issue.Thanks Vishal.
Original comment by vishalb...@gmail.com
on 24 May 2013 at 9:24
Hi ngmm..,
Thanks a lot.
Original comment by alok....@gmail.com
on 1 Aug 2013 at 9:49
use this http://db.tt/yQjhqeq3 patched linkedin-j library and refer to this
link for usage http://stackoverflow.com/a/13510881
Original comment by rbprakas...@gmail.com
on 8 Aug 2013 at 11:20
how to get all types of network update ? Not just SHARED_ITEM or STATUS_UPDATE ?
Original comment by psagg...@gmail.com
on 27 Jan 2014 at 8:38
Original issue reported on code.google.com by
ngmm...@gmail.com
on 1 Sep 2012 at 10:55