3

I am integrating facebook, twitter, github, linkedin using https://oauth.io/signin third party site. I integrated facebook and was able to successfully get id, name, gender properties directly but am seeing difficulty in getting email address, location values.

enter image description here

In oauth.io site, I even added scope permissions for facebook

enter image description here

I am using the below code to get info of the logged in user.

OAuth.popup('facebook')
            .done(function (result) {
                res = result;
                result.me().done(function (response) {
                    debugger;
                    console.log('me ' + response.name);
                    console.log('me ' + response.email);

                });
            })
            .fail(function (error) {
                alert('fail');
            });

I even tried filtering the results only to give email, birthdate values using

OAuth.popup('facebook')
            .done(function (result) {
                res = result;
                result.me(['email', 'birthdate', 'location']).done(function (response) {
                    debugger;
                    console.log('me ' + response.name);
                    console.log('me ' + response.email);

                });
            })
            .fail(function (error) {
                alert('fail');
            });

But it just returned empty object. Can some one let me know if I am missing something?

aemxdp
  • 1,348
  • 1
  • 14
  • 34
G_S
  • 7,068
  • 2
  • 21
  • 51
  • did you fix it? I am facing the same issue. facebook is working fine but not able to configure linkedin n google. on oauth.io it is working fine. Not able to implement it. – Roxx Oct 30 '16 at 10:04

1 Answers1

3

I was able to get the required fields for facebook using

 result.get('/me?fields=name,email,gender,birthday').done(function (response) {
                    console.log('me ' + response.name); 
  });

But the same code is not working for twitter. Still looking for an answer which works in a generic way for most of the apis

G_S
  • 7,068
  • 2
  • 21
  • 51
  • Hi - did you find an answer to the problem? – Ruben Feb 19 '16 at 07:57
  • Thanks! this is strange - for us it works with twitter & google+; we only have the problem with Facebook. Btw, are you still using oauth.io, or did you find an alternative? – Ruben Feb 20 '16 at 12:21
  • am still with oauth.io – G_S Mar 14 '16 at 17:47
  • fyi: the issue has been fixed: https://github.com/oauth-io/oauthd/commit/7beec64ab39955c3afd2eb28ecf7288c74ccdc96 – Ruben Mar 14 '16 at 19:26