nraboy / ng-cordova-oauth

AngularJS oauth library for use with Apache Cordova projects
https://www.thepolyglotdeveloper.com
MIT License
456 stars 199 forks source link

$cordovaOauth.linkedin returning null data and status -1 #270

Closed maggix closed 8 years ago

maggix commented 8 years ago

Hi, I have been using ngCordovaOauth with LinkedIn provider in an Ionic 1.3.1 project. However, I keep getting "Problem authenticating" message from the library.

I cloned the repository, tried adding some debug messages and this is what is going on:

Observations:

Are you able to reproduce, and perhaps suggest what could be wrong? Thanks

nraboy commented 8 years ago

Hey @gmaggini,

Thanks for the level of detail you've given me!

A few questions:

  1. Has this library ever worked for you when it comes to LinkedIn?
  2. If the answer to the previous was yes, can you try to use 0.2.9 of the library rather than the latest which is 0.2.10? Wondering if I broke something.

Best,

maggix commented 8 years ago

Hi @nraboy , this is my first time using this library so I went straight to the latest version. I will however test the library using a new empty app and see if it works and update this issue.

While we are at it: LinkedIn's documentation for OAuth (here) suggests to use https://www.linkedin.com/oauth/v2/authorization and https://www.linkedin.com/oauth/v2/accessToken as endpoints, while the ones currently in the library seem to be the endpoints for the legacy Oauth . However, even replacing them did not solve the problem for me, which seems to lies into the $http post request ...

nraboy commented 8 years ago

Hey @gmaggini,

I just tried LinkedIn with the example app that I put on GitHub:

https://github.com/nraboy/ng-cordova-oauth-example

I replaced the library in that sample project with the latest ng-cordova-oauth release and LinkedIn worked fine. This leads me to believe that maybe you didn't configure your application correctly in the LinkedIn dashboard.

However, if LinkedIn is recommending a new set of URLs, this could be a problem in the long term. Although they haven't deprecated the current, now we know it is coming. Would you like to contribute to this project and make the changes? It would get you some bonus points being an open source contributor.

Let me know, otherwise I'll see about updating the URLs in the next week or so.

Best,

cc @matheusrocha89

maggix commented 8 years ago

I will work again on this by end of this week and update this issue. Also contribute to this project.

In the meanwhile, additional finding: the status -1 returned from $http in my Ionic project is a problem I have everywhere in the app.

maggix commented 8 years ago

Hi. The issue was related to the config.xml file not having the right allow-intent set. Thank you for your help

santu-git commented 8 years ago

@gmaggini can you please let me know which allow-intent need to set?? I am also facing the same issue. $http request to https://www.linkedin.com/uas/oauth2/accessToken always returning status -1. Though $http request to my server is working fine just above the linkedine request.