0
我需要Google上自定義方案的幫助。 我成功從代表團獲取用戶列表。 以下是我的代碼。Google管理員SDK自定義方案問題
$client = new \Google_Client();
$client->setApplicationName('xx');
$scopes = array('www.googleapis.com/auth/admin.directory.user','www.googleapis.com/auth/admin.directory.userschema');
$client->setAuthConfig('C:\Users\xx\xx\public\client_secret.json');
$client->setScopes($scopes);
$user_to_impersonate = 'xx.sg';
$client->setSubject($user_to_impersonate);
$dir = new \Google_Service_Directory($client);
$r = $dir->users->get('[email protected]');
dd($r);
Userscheme也已添加到Google中。
但我得到的自定義方案是空的。
https://i.stack.imgur.com/0JcfZ.png
如果我使用投影=充滿developers.google.com/admin它的工作原理。
https://i.stack.imgur.com/9s3MQ.png
有人能幫忙嗎?
感謝彼得。這是工作。希望你有一個美好的一天。 – Jerry