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

Wrong flowUrl value for facebook #231

Closed sn-satyendra closed 8 years ago

sn-satyendra commented 8 years ago

The flowUrl used for facebook login currently is(line 25 of oauth.facebook.js):

var flowUrl = "https://www.facebook.com/v2.0/dialog/oauth?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=token&scope=" + appScope.join(",");

But the request parameter "scope" used above actually should be "fields" as per the facebook graph api. This is causing a error response "error_code=100 : Invalid permissions". Correcting the request parameter resolves the issue.

nraboy commented 8 years ago

Can you provide a link to this documentation stating that scope is now fields?

sn-satyendra commented 8 years ago

You can see the url in graph api explorer https://developers.facebook.com/tools/explorer/

For different versions of api the parameter is "fields" only which takes comma separated values for list of permissions.

nraboy commented 8 years ago

The Facebook APIs are not the same as Facebook Login:

https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login

The Facebook documentation is still using scope. If you are receiving a 100 error it means you are trying to include invalid permissions in your scope.

Here are the valid scope permissions:

https://developers.facebook.com/docs/facebook-login/permissions/

Regards,