Google PHP Client API: Insufficient Permission

后端 未结 2 561
萌比男神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)
    );
    
    0 讨论(0)
  • 2020-12-06 21:45

    You must even disable Google drive api for your project in Developer Console under Apis & auth

    0 讨论(0)
提交回复
热议问题