Background
Our corporate users have a Google Apps account. We would like to allow them (and only them) to log in to an extranet using the Google account. Ideally we would also like to manage permissions through the Google domain management UI. One thought is to create groups and associate group membership with extranet permissions.
Research
Google Apps supports login using OAuth 2.0 and also supports provisioning via API, which would allow us to test if a user is a member of a group. The Provisioning API presumably requires administrator credentials.
Question
Is it possible to programatically determine whether a Google Apps user is a member of a group without requiring domain administrator credentials?
Is there a better way to accomplish this goal?
Get-ADUserMemberOf -User “User” -Group “Group” It will return True if user is member of group and will return False if user is not member of the group.
Explanation: id -nG $USER shows the group names a user belongs to. grep -qw $GROUP checks silently if $GROUP as a whole word is present in the input.
If a person chooses to become a member of a new social group, similarly the associations between the social groups and the self are determined by the compatibility between the new in-group and the previous in-group.
Hit Windows+R, type “lusrmgr. msc” into the Run box, and then hit Enter. In the “Local Users and Groups” window, select the “Users” folder, and then double-click the user account you want to look at. In the properties window for the user account, switch to the “Member Of” tab.
The API call to check group membership does require at least a delegated admin with rights to read groups via the API. If you utilize the new Google Admin SDK membership API call, you can also limit the scope to readonly:
https://www.googleapis.com/auth/admin.directory.group.readonly
The Admin SDK utilizes OAuth 2.0 which does not require the delegated admin's username/password, only the OAuth token.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With