Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 403, access to network denied error #35

Open
sumanranjanpanda opened this issue Apr 14, 2016 · 0 comments
Open

Getting 403, access to network denied error #35

sumanranjanpanda opened this issue Apr 14, 2016 · 0 comments

Comments

@sumanranjanpanda
Copy link

Hi,

I am getting 403, access to network denied error everytime when I try to share or fetch network updates.

I have followed the README, and used linkedin gem to call linkedin APIs.

When I used below configuration

provider  :linkedin,
            LINKEDIN_SETTINGS[:linkedin_api_key],
            LINKEDIN_SETTINGS[:linkedin_api_secret],
            :scope => 'r_fullprofile r_emailaddress r_network', :fields => ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location", "connections"]

I got the below error.

OAuth::Problem - Scope NOT_AUTHORIZED : r_fullprofile, Scope NOT_AUTHORIZED : r_network:

Then I have tried with the scope 'r_basicprofile r_emailaddress w_share'

provider  :linkedin,
            LINKEDIN_SETTINGS[:linkedin_api_key],
            LINKEDIN_SETTINGS[:linkedin_api_secret],
            :scope => 'r_basicprofile r_emailaddress w_share', :fields => ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location", "connections"],

It worked, but When I am trying to share or to get network updates. I am gettng 403 Access to network denied error. Even I have tried with https using ngrok.

client.add_share(share)
client.network_updates
  def get_posts(credentials, options = {})
    client = prepare_client(credentials["token"], credentials["secret"])
    posts = client.network_updates(options)
    return posts
  end

  private
  def prepare_client(oauth_token, oauth_token_secret)
    client ||= LinkedIn::Client.new(api_key, api_secret)
    client.authorize_from_access(oauth_token, oauth_token_secret)
    return client
  end

share =    {
      "comment": comment,
      "content": {
        "title": title,
        "description": description # ,
        # "submitted-url": "https://developer.linkedin.com",  
        # "submitted-image-url": "https://example.com/logo.png"
      },
      "visibility": {
        "code": "anyone"
      }  
    }
  client.add_share(share)

I have also tried to use the example as in your document. And that too didn't work for me.

You can now make API calls as per normal e.g.:

client.profile
client.add_share({:comment => "blah"})

In my linkedin app, I have checked all the application permissions
https://www.linkedin.com/developer/apps
Default Application Permissions:

  • r_basicprofile
  • r_emailaddress
  • rw_company_admin
  • w_share

Could you please help me on this issue?

Thanks,
Suman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant