После успешной аутентификации в Google API.Я получаю сообщение об ошибке «Домен не найден».Не получается, как назначить домен для запроса.вот мой код
gapi.load ("client: auth2", function () {
gapi.auth2.init({ client_id: 'client id' });
});
function updateSigninStatus(isSignedIn) {
// When signin status changes, this function is called.
// If the signin status is changed to signedIn, we make an API call.
if (isSignedIn) {
loadClient()
execute();
clearInterval(s);
}
}
function authenticate() {
return gapi.auth2.getAuthInstance()
.signIn({ scope: "https://www.googleapis.com/auth/admin.directory.user" }) // ux_mode: "redirect", prompt: "none"
.then(function () { console.log("Sign-in successful"); },
function (err) { console.error("Error signing in", err); });
}
function loadClient() {
return gapi.client.load("https://content.googleapis.com/discovery/v1/apis/admin/directory_v1/rest")
.then(function () { console.log("GAPI client loaded for API"); },
function (err) { console.error("Error loading GAPI client for API", err); });
}
// Make sure the client is loaded and sign-in is complete before calling this method.
function execute() {
console.log(gapi.client.directory.users.list());
}