I'm using the Admin SDK Directory api to read users out of a domain. Everything works fine except for the fact that the users.list
is returning groups as part of that list. While not devastating it causes some confusion when users are using my app.
The method in question can be found here.
https://developers.google.com/admin-sdk/directory/v1/reference/users/list
I don't even use the scopes for groups. I have authorization for the https://www.googleapis.com/auth/admin.directory.user.readonly
scope only, not any related to groups.
Here is an example of a user entry returned (with names and such obviously changed):
{
"kind": "admin#directory#user",
"id": "someId",
"etag": "\"An etag\"",
"primaryEmail": "group@domain.com",
"isAdmin": false,
"isDelegatedAdmin": false,
"lastLoginTime": "1970-01-01T00:00:00.000Z",
"creationTime": "1970-01-01T00:00:00.000Z",
"agreedToTerms": false,
"suspended": false,
"changePasswordAtNextLogin": false,
"ipWhitelisted": false,
"emails": [
{
"address": "group@domain.com",
"primary": true
}
],
"customerId": "customer",
"orgUnitPath": "/",
"isMailboxSetup": true,
"includeInGlobalAddressList": true
}