Can a normal user account in my domain access the function on Google OAuth2 directory service API to retrieve users list or data ?
I have a web-application which allow the users to login with OAuth2.0. After that, the users should be able to see their profile data.
If I am using a super admin login, everything work just fine which the data is displayed. When I am using a normal user login and a group admin login, I cannot see any data and receive error message as follow:
Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/admin/directory/v1/users/yifei.liu@example.com?key=(MY_API_Key): (403) Not Authorized to access this resource/api' in /home2/iaapro/public_html/php/google-api-php-client/src/io/Google_REST.php:66 Stack trace: #0 /home2/iaapro/public_html/php/google-api-php-client/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest))
#1 /home2/iaapro/public_html/php/google-api-php-client/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest))
#2 /home2/iaapro/public_html/php/google-api-php-client/src/contrib/Google_DirectoryService.php(653): Google_ServiceResource->__call('get', Array)
#3 /home2/iaapro/public_html/php/google-plus-access.php(47): Google_UsersServiceResource->get('yifei.liu@iaapr...')
#4 /home2/iaapro/public_html/php/index.php(2): include_once('/home2/iaapro/p...')
#5 {main} thrown in /home2/iaapro/public_html/php/google-api-php-client/src/io/Google_REST.php on line 66
Does it mean that only account with domain super admin rights can access the Google Admin SDK Directory API ? Is it possible for me to allow normal user to use this API too ?
Thanks.