Google Admin Console allows us to manage third-party App Access Control for OAuth apps registered and used for SSO. Is there an API to discover this list?
Asked
Active
Viewed 370 times
1 Answers
1
You can use the Reports API, method activities.list.
You can try the following example with Apps Script, this script will retrieve the list of the third-party apps.
function appAccessControl() {
var eventName = {
"eventName": "authorize"
};
var appsList = [];
var response = AdminDirectory.Activities.list("all", "token", eventName);
for(var i=0; i< response.items.length; i++)
{
if(appsList.includes(response.items[i].events[0].parameters[1].value)==false)
{
appsList.push(response.items[i].events[0].parameters[1].value);
}
}
console.log(appsList);
}
Note: To run this script you need to add the "Admin SDK API" service in your Apps Script project, on the left side of the screen, click on the “+” next to “Services”, search for “Admin SDK API”, select "reports_v1" from "Version", and click “Add”.

Lorena Gomez
- 1,946
- 2
- 4
- 11
-
Thanks, @lorena, I was suspecting the same, as I could query the reporting API to get some data, but I assume is based on user activity so not a foolproof approach. Thanks for the help – Chandermani Aug 10 '22 at 05:46