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

Hey you two,
I am facing the same problem, been trying to add users to an organization with a Http Request activity, but didn’t get it to work. My main problems is the token, it expires after some minutes.
Is there a way to create a refresh token or something? (And how would I implement it in Google-Cloud?)
@Edwin_Barahona mentioned some options on getting a token, but haven’t gotten it to work for me.
Any suggestions on how to create the right credential and where to put the ID to get a fitting token, which lasts and is reliable?

Thank you in advance!

Hi @Melilli_Calogero-Pio,

This falls more on the scope of google apis, here’s a link regarding refresh tokens also in there you can find more details regarding authentication

Also, you can now create custom connectors from UiPath platform instead of using a custom web server

1 Like