Google PHP Client API: Insufficient Permission

后端 未结 2 565
萌比男神i
萌比男神i 2020-12-06 21:06

I have PHP code that use Google PHP Client API to use Drive service.



        
2条回答
  •  不知归路
    2020-12-06 21:40

    The apps#list method requires authorization with the scope https://www.googleapis.com/auth/drive.apps.readonly. Just add it to the array of scopes:

    $client->setAssertionCredentials(new Google_Auth_AssertionCredentials(
      SERVICE_ACCOUNT_NAME,
      array('https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.apps.readonly'),
      $key)
    );
    

提交回复
热议问题