LinkedIn login with ionic app not working

Viewed 376

I am trying (OAuth) LinkedIn login through my ionic app. How is it done?

I have a few questions. What is the purpose/importance of these parameters: clientId, clientSecret, appScope and state? Also how to obtain those to make my code work?

I have added the ng-cordova plugin: https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

Controller code is:

.controller('myCtrl', function($scope, $cordovaOauth){
       $scope.linkedInLogin = function() {

  $cordovaOauth.linkedin(string clientId, string clientSecret, array appScope, string state).then(function(result) {
      console.log(JSON.stringify(result));
  }, function(error) {
      alert("Error : " + error);
    });
  }
});

Html code:

<ion-content ng-controller="myCtrl">
    <button class="button button-bar button-positive" ng-click="linkedInLogin()">Login with LinkedIn</button>
</ion-content>
0 Answers
Related