Я разрабатываю php-приложение с использованием Google Classroom и продолжаю получать «код»: 403, «message»: «В запросе недостаточно областей аутентификации». ошибка.
Вот что я сделал до сих пор, любая помощь будет огромной!
Я настроил oauth для своего приложения на использование auth / classroom.push-notifications
Я установил classroom-notifications@system.gserviceaccount.com, чтобы иметь роль Pub / Sub Publisher
Я настроил паб / подтему
Вот код, который я использую:
$google_course_id = '123456';
$topic_name = 'projects/my-app-name/topics/TopicName';
$feed_type = 'COURSE_WORK_CHANGES';
$user = User::find(2); // User who has authorized via OAuth and accepted all permissions
$client = new Google_Client();
$client->setAccessToken($user->get_google_social_token());
$classroom = new Google_Service_Classroom($client);
$pub_sub = new Google_Service_Classroom_CloudPubsubTopic();
$pub_sub->setTopicName($topic_name);
$work_changes_info = new Google_Service_Classroom_CourseWorkChangesInfo();
$work_changes_info->setCourseId($google_course_id);
$feed = new Google_Service_Classroom_Feed();
$feed->setCourseWorkChangesInfo($work_changes_info);
$feed->setFeedType($feed_type);
$registration = new Google_Service_Classroom_Registration();
$registration->setCloudPubsubTopic($pub_sub);
$registration->setFeed($feed);
$classroom->registrations->create($registration);
К сожалению, я получаю ошибку 403.
Любая помощь в определении того, что мне не хватает, будет принята с благодарностью!