【发布时间】:2016-08-02 18:51:41
【问题描述】:
我想使用我现有的身份验证并能够使用相同的身份验证来执行对 Google Directory API 的获取请求。这是我当前的代码:
login() {
this.firebaseRef = new Firebase('https://xxx.firebaseio.com');
this.firebaseRef.authWithOAuthPopup("google", (error, authData) => {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload:", authData);
}
}, {
scope: "https://www.googleapis.com/auth/admin.directory.user.readonly"
});
}
getData() {
// TO-DO
// Recognise existing OAuth and perform a GET request to
// https://www.googleapis.com/admin/directory/v1/users?domain=nunoarruda.com
}
【问题讨论】:
标签: firebase angular google-oauth google-admin-sdk google-directory-api