Extract Google API Bearer Token

Hi All,

I have been trying for some time now to use UiPath to generate a Google API Bearer token. This is done automatically by the smart coding done on the Gsuite activity and I have seen a previous post where another user wanted to receive the output token from the Application Scope authentication so that it can be passed on but due to security concerns, the answer was no.

I find myself in a similar scenario where I would like to use BigQuery to send data to. I have managed to build an automation that can convert a data table into the JSON body needed to insert the data into BigQuery. I have also been able to test this using the Google OAuth2 Playground to generate a Bearer Token and provide this in the header of the API call. However, these are throw away tokens and I need to use a service account instead.

Where I am stuck, and with no programming experience, is constructing the JWT for the service account I want to use, more specifically the Signing of the encoded header and claims set using the p12 key and SHA256withRSA. If I could crack this part (using UiPath or InvokeCode within UiPath) then I would not need you to output the token.

This is what I have been working with: https://developers.google.com/identity/protocols/oauth2/service-account#httprest_1

Any help or a point in the right direction would be greatly appreciated

Hello @Gerard_McNamara_Ged!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff