Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine Whether User is Group Member

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?

like image 665
Eric J. Avatar asked May 17 '13 04:05

Eric J.


People also ask

How can I tell if a user is a member of a group?

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.

How do you check if a user is a member of a group in Linux?

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.

What determines membership in a group?

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.

How do you check if a user is part of a group windows?

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.


1 Answers

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.

like image 165
Jay Lee Avatar answered Sep 20 '22 05:09

Jay Lee