Google Classroom quickstart.php perfectly worked for me.
Now I need to create web page which prompts user to Login (Oauth) and with those credentials I need to list their Courses.
I tried the sample in Google Classroom questions but all ending up with Google Errors.
Any Working Sample would be highly appreciated.
Thanks in Advance.
1) First Let me know whether the below example is correct
<?php
require __DIR__ . '/src/Google/autoload.php';
/*TODO: get stored $credentials */
$client = new Google_Client();
$client->setClientId('myServiceAccountClientID');
$client->setRedirectUri('REDIRECTURI_PAGE');
$client->setClientSecret('SECRETKEY');
$client->setScopes(array('https://www.googleapis.com/auth/classroom.courses','https://www.googleapis.com/auth/classroom.courses.readonly'));
$client->setAccessToken($credentials);
$service = new Google_Service_Classroom($client);
$results = $service->courses->listCourses();
?>
$credentials is the value of $GET[code] which I got by running Quickstart.php