Read only scope for Google admin settings API

769 Views Asked by At

I was trying to retrieve the organization name of the user using the OAuth mechanism (in java on Google app engine). The scope that I used is

https://apps-apis.google.com/a/feeds/domain/

However this scope is giving Manage your domain settings option, which seems very scary for the end customers. Attached below is the screenshot of that.

with out read only option

so, is there is a read only version of this scope, so that it can be only View your domain settings

I tried using the following scopes in the OAuth playground,

https://apps-apis.google.com/a/feeds/domain.readonly

https://apps-apis.google.com/a/feeds/domain/#readonly

but every time I was bit by invalid oauth scopes URI. Attached below is the screenshot.

With readonly option

Any help is very much appreciated. Thanks in advance.

2

There are 2 best solutions below

0
On

This is documented at [1]. You can use "https://www.googleapis.com/auth/admin.directory.user.readonly" scope. Org Unit will be listed under "orgUnitPath" of the returned user resource.

[1] - https://developers.google.com/admin-sdk/directory/v1/reference/users/list

1
On

To solve this problem what you can do is: go to Admin Console > Security > API Controls > Domain Wide Delegation

Select you App, click on Edit and add your scope "https://apps-apis.google.com/a/feeds/domain"

Now click on Authorise. Done Now you can generate access token by including this scope and access Google Admin Setting API.