Directory API Google using http request Activiy

Hello to all friends, I am trying to configure the http request activity, to be able to use Google’s Admin SDK Directory API, to be able to manage the accounts of my organization such as adding new users, generating 8-digit passwords, changing passwords. Are any of you familiar with the use of this API? I read that Auth 2.0 should be generated but I don’t know how to configure it in the http activity.
Thanks.

So, this is an interesting topic. I’m a bit rusty with Google API’s this is as best as I can recommend:

Context:
Using OAuth 2.0 you will need to register the application in the Google API console and you will be required to provide a redirect URI to receive the OAuth response token meaning that you can either have a web server running (node i’m looking at you :eyes: ) ideally running on https

Recommendations:
First, you will need to get your oauth credentials from the developer console of google and create a scope of the APIs you need to access, in your case the directory API
UiPath Httprequest offers the option to authenticate with an OAuth2 token but you will need to get the token first.

Getting the token:
Remember I mentioned the redirect URI, this is where it becomes interesting, you need a web server ideally running on https to receive the response from your authentication request, there are 2 ideas that come to my mind

  1. Set a web service with node.js you may launch calling powershell scripts
  2. Create a UiPath App, then use the generated URL as your redirect URI and send the request through a browser (not ideal, but works when not many choices are available)
  3. using Open SSL you can have IIS to launch localhost on https
  4. Create an API service account, I haven’t fully explored this one but sounds promising

Implementation:
Would love to help but we may reach a dimension beyond the scope of this forum… a tip. Leverage OAuth playground

Alternative:

  • If you’re the server admin, and your organization uses LDAP/Active directory, then you should instead go for GSuite Directory Sync and sync it directly with AD.

TL;DR; here are the resources:

https://nodejs.org/api/https.html

1 Like