GithubHelp home page GithubHelp logo

Comments (5)

PoBuchi avatar PoBuchi commented on August 22, 2024

Hi @hafeez1042,
it works identically as other Meteor native login packages - Google, Facebook, etc.

from meteor-accounts-linkedin.

nicholasalanbrown avatar nicholasalanbrown commented on August 22, 2024

I can't get this to work:

if (Meteor.isClient) {

    Accounts.ui.config({
        requestPermissions: {
            linkedin: ['iindustry'],
        },
    });

}

if (Meteor.isServer) {
    Meteor.startup(function() {
        ServiceConfiguration.configurations.remove({});
        ServiceConfiguration.configurations.insert({
            service: "linkedin",
            clientId: "774nha79etnktx",
            secret: "l6ZbFEDQ2D0hENo1",
            requestPermissions: ['industry']
        });
    });
}

but my terminal just outputs:

W20151117-15:23:00.519(-5) (oauth_server.js:71) Unable to base64 decode state from OAuth query: undefined
W20151117-15:23:00.522(-5) (oauth_server.js:71) Unable to base64 decode state from OAuth query: undefined
W20151117-15:23:00.523(-5) (oauth_server.js:398) Error in OAuth Server: invalid_scope

It does this no matter which fields I request...

from meteor-accounts-linkedin.

nicholasalanbrown avatar nicholasalanbrown commented on August 22, 2024

On further inspection, this works fine with:

    Accounts.ui.config({
        requestPermissions: {
            linkedin: ['r_basicprofile'],
        },
    });

but doesn't work passing in something like ['industry']. How do I access these fields: https://developer.linkedin.com/docs/fields/basic-profile ?

from meteor-accounts-linkedin.

MatasJonys avatar MatasJonys commented on August 22, 2024

First of all, you need to get the access token, so you need to login.
Then you can test out this snippet:

      var user = Meteor.user();
      var accessToken = user.services.linkedin.accessToken;
      // http://developer.linkedin.com/documents/profile-fields
      var basicProfileFields = ['first-name', 'last-name', 'maiden-name', 'formatted-name', 'phonetic-first-name',
      'phonetic-last-name', 'formatted-phonetic-name', 'headline', 'location',
      'industry', 'num-connections', 'num-connections-capped', 'summary',
      'specialties', 'positions', 'picture-url', 'picture-urls::(original)', 'site-standard-profile-request'],
      emailFields = ['email-address'],
      fullProfileFields = ['last-modified-timestamp', 'proposal-comments', 'associations', 'interests', 'publications',
      'patents', 'languages', 'skills', 'certifications', 'educations',
      'courses', 'volunteer', 'three-current-positions', 'three-past-positions', 'num-recommenders',
      'recommendations-received', 'following', 'job-bookmarks', 'suggestions', 'date-of-birth'],
      contactInfoFields = ['phone-numbers', 'bound-account-types', 'im-accounts', 'main-address', 'twitter-accounts', 'primary-twitter-account'];

      var requestUrl = 'https://api.linkedin.com/v1/people/~:(' + _.union(basicProfileFields, emailFields, fullProfileFields, contactInfoFields).join(',') + ')';

      var response = HTTP.get(requestUrl, {
        params: {
          oauth2_access_token: accessToken,
          format: 'json'
        }
      });
      if (response) {
        console.log(response);
      }

from meteor-accounts-linkedin.

nicholasalanbrown avatar nicholasalanbrown commented on August 22, 2024

Got that working, thanks! I think what I'll do is just make this request when accounts are created on the server side and add them to the profile.

from meteor-accounts-linkedin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.