Reputation: 2213
Is it possible to control access to a request handler entirely or some parts therein based on what GSuite for Education/Business group a user belongs to?
Upvotes: 0
Views: 231
Reputation: 39834
It is possible to have code check the GSuite group membership using the Directory API from the Google Apps Admin SDK. You'd probably be interested in one of:
You'll need to
G Suite administrators have access to the Admin SDK–a collection of Application Programming Interfaces (APIs). With these APIs, you can build customized administrative tools for your G Suite products. Before you can use the Admin SDK, you need to enable API access in the Google Admin console.
You must be signed in as a super administrator for this task. Enable API access
To verify that API access is enabled:
Sign in to your Google Admin console.
Sign in using an administrator account, not your current account [email protected].
From the Admin console dashboard, go to Security > API reference.
To see Security on the dashboard, you might have to click More controls at the bottom.
Make sure the Enable API access box is checked.
At the bottom, click Save.
enable the Admin SDK
API from the Google Apps APIs
group in for your GAE app's API Manager page
install the Google API Client Library in your GAE app (if not already done)
address authentication, posibly using your GAE app's service account. See Google API Client Libraries Authentication Overview. And maybe related App Engine OAuth2.0 authorized cron job to analyze Google Sheet.
(if you want to) restrict app access to only your GSuite domain, see Restrict App Engine access to G Suite accounts on custom domain
code your access control logic using the directory api to obtain group membership info
Upvotes: 1