oauth 2.0 - Does Firebase provide access token for consuming Google API's (Contacts, Calender)? -
i have code accessing google contacts api using firebase. authenticates user , returns access_token not seem work accessing contacts api(i using angularfire). here code:
var ref = new firebase("<<firebase-app>>"); $scope.click = function() { ref.authwithoauthpopup("google", function (error, authdata) { if (error) { console.log("login failed!", error); } else { console.log("authenticated payload:", authdata); console.log(authdata.google.accesstoken); var resource = "https://www.google.com/m8/feeds/contacts/default/full?alt=json&access_token=" + authdata.google.accesstoken; $.getjson(resource,function (response) { console.log(resource); }); }
the error received is: https://www.google.com/m8/feeds/contacts/default/full?alt=json&access_token… 401 (ok)
here format of authdata received:
-auth -provider -uid -expires -google -accesstoken -displayname -id -cacheduserprofile -provider -token -uid
Comments
Post a Comment