Oauth 2.0 Firebase是否为使用Google API提供访问令牌;s(联系人、日历)?
我有使用firebase访问GoogleContactsAPI的代码。 它对用户进行身份验证并返回access_令牌,但它似乎无法访问Contacts API(我使用的是AngularFire)。代码如下:Oauth 2.0 Firebase是否为使用Google API提供访问令牌;s(联系人、日历)?,oauth-2.0,google-api,firebase,google-contacts-api,google-oauth,Oauth 2.0,Google Api,Firebase,Google Contacts Api,Google Oauth,我有使用firebase访问GoogleContactsAPI的代码。 它对用户进行身份验证并返回access_令牌,但它似乎无法访问Contacts API(我使用的是AngularFire)。代码如下: var ref = new Firebase("<<FIREBASE-APP>>"); $scope.click = function() { ref.authWithOAuthPopup("google", function (error, authData
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 successfully with 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);
});
}
尝试使用key而不是access\u令牌也不使用key。您确定url正确吗?我现在正在翻文档。它不应该更像是在用户已经通过身份验证时使用默认值吗。
-auth
-provider
-uid
-expires
-google
-accessToken
-displayName
-id
-cacheduserprofile
-provider
-token
-uid