thephpleague / oauth2-google

Google Provider for the OAuth 2.0 Client
MIT License
396 stars 74 forks source link

Cannot access customers informations because I'm not admin. #116

Open VincentLanglet opened 2 years ago

VincentLanglet commented 2 years ago

I saw the following issues about groups: https://github.com/thephpleague/oauth2-google/issues/86

When connecting to google with oauth, I added the scope

https://www.googleapis.com/auth/admin.directory.customer.readonly

Then I try to access to

'https://admin.googleapis.com/admin/directory/v1/customers/my_customer'

I'm getting an error Not Authorized to access this resource/api. According to some research, it seems like that the api can only be requested by admins. (I tried with an admin and it works). If I want to do it with a non-admin user, it require impersonating https://developers.google.com/admin-sdk/directory/v1/guides/delegation#python

How is this supported with this library ? @shadowhand

bradjones1 commented 1 year ago

This seems out of scope/support request for Google's API rather than anything this library is responsible for.