@Jeevan R,
Is that your actual private key value? If so, it's invalid. That' way to short for a Google private key. To answer your question though, the way I typically handle the credential is by making use of Credential Manager. Here's an example:
Regarding your private key value, all you have to do is pull that out of the JSON-encoded credential file that Google makes available when you create the credential in the Google Console.

My private key value, from the first "-" to the trailing "\n" is 1732 characters long. You take those two values (
client_email and
private_key) and use them to populate your Blue Prism Credential Manager entry.
After I have the client_email and private_key values, I create a JWT Bearer token definition in Credential Manager. In reality, you could create a regular
General credential if you wanted to now that the authentication will be handled by the new VBO. You just need a Username and Password value.

Next, in my process, I'll use the native Credential VBO to get the Username and Password value based on the name of the credential.

After that, I call the
Google Cloud - Authentication VBO's
Get Service Account Token action and pass in the Username, Password, my scopes, and the delegated user email address.

From that, I should receive a valid access token. The access token should be about 208'ish characters long.
Hint: If the token is longer, and contains a bunch of periods at the end, it's not a valid token.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
Original Message:
Sent: 03-24-2022 10:08
From: Jeevan R
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
@Eric Wilson
I have provided the Delegated user and still, I get the same error is this the proper way of providing the credentials and does BP 7.0 support this version of the API?

Best Regards,
------------------------------
Jeevan R
Original Message:
Sent: 03-23-2022 14:02
From: Eric Wilson
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
@Jeevan R,
Try adding a user email to the Delegated User input. Even though you're using a service account, GMail seems to be one of those services where Google expects you to work on behalf of a specific user. The user account you would enter there would be whatever user email you expect to send/receive emails with.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
Original Message:
Sent: 03-23-2022 09:45
From: Jeevan R
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
@Eric Wilson
Thank you for the response,
I installed the latest version of Gmail API and also installed the google cloud authentication, still I am facing the same error I have attached the screenshot:

Please help me resolve this error
-----BEGIN PRIVATE KEY-----\n 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 \n-----END PRIVATE KEY-----\n
I have provided the password in the above format.

These are the inputs that I have provided.
------------------------------
Jeevan R
Original Message:
Sent: 03-23-2022 04:03
From: Eric Wilson
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
@Jeevan R,
One other thing I forgot to mention. Creating a message in GMail, via the REST API, is a little complex as the REST API expects you to be working at the base 64 encoded MIME message level. Because of that, I'm working on a small helper VBO that will allow you to input the basic information of an email (ex. To, From, Subject, Body, and Attachments) and it will create the raw message data for you. Then all you have to do is pass it along into the GMail API.
I should have that ready in the next day or two.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
Original Message:
Sent: 03-22-2022 22:23
From: Eric Wilson
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
@Jeevan R,
The updated GMail API v1 - 1.1.1 connector and new Google Cloud - Authentication VBO have been posted to the DX. I HIGHLY recommend that you remove the existing skill before installing the newer v1.1.1 .bprelease.
The new connector is only a WebAPI service definition. There is no longer a Blue Prism skill attached to it. This makes it easier to customize the connector in your own environment if necessary.
To work with the new connector, you need to first make an authentication request using the Google Cloud - Authentication VBO to get your service account access token. Once you have the token you can pass it into your calls to the new GMail API v1 connector.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
Original Message:
Sent: 03-21-2022 09:27
From: Jeevan R
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
Hi @Eric Wilson,
Thanks for the valuable response, hope to see the latest version in DX ASAP.
Best Regards,
------------------------------
Jeevan R
Original Message:
Sent: 03-20-2022 20:17
From: Eric Wilson
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
Hi @Jeevan R,
I haven't tested this in v7, but in v6.10.4 I was able to recreate your specific error by trying to build my own JWT and singing it with the private key without normalizing the format of the private key value. What I mean by that is the format Google provides the key in actually Unix-focused. That's because the newlines used in the key definition are just \n whereas a newline in Windows is actually \r\n.
It could be that something was broken in the v7 codebase because previously the Web API feature properly handled the normalization of the private key (PKCS #8) into the correct PEM base 64 format.
So, as I've been looking over this I decided there are some things we can do to improve this overall (regardless of what the possible issue is in v7). We're are working on a new release of the GMail API v1 connector that will remove the native authentication handling within the Web API. We're going to implement it directly using the Google APIs Auth library. That will give you a VBO dedicated to handling the authentication/authorization and returning the needed token.
We should have this new implementation finished this week and, hopefully, posted to the DX by the end of the week.
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
Original Message:
Sent: 03-18-2022 04:31
From: Jeevan R
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
Hi Eric Wilson,
Thanks for the response, for your information I am using get messages using the gmail connector, i have done all the pre-requisites i am facing the error which is attached above, i think this is because of invalid character in credentials, below is the screenshot of credential configuration, please let me know if you need any more information.
-----BEGIN PRIVATE KEY-----\n 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 \n-----END PRIVATE KEY-----\n

Regards,
------------------------------
Jeevan R
Original Message:
Sent: 03-18-2022 00:09
From: Eric Wilson
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
Hello @Jeevan R,
What actions on the GMail connector are you trying to execute?
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
Original Message:
Sent: 03-17-2022 10:29
From: Jeevan R
Subject: Gmail API vbo throws exception - invalid base 64 character or invalid padding.
Hello Community,
I am trying to get mails from Gmail through an API connector which is there in digital exchange, I have created the project in google cloud platform, enabled the Gmail API, created O-Auth credentials and service account as pre-requisites.
I have imported the Gmail API VBO and set the key in the credential manager, I am getting this error when I execute the process
"Internal : Unexpected error The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. "
I request your help on resolving this, I have attached the screenshot below,
Please let me know if you require any more information.
Regards,
Jeevan

------------------------------
Jeevan R
------------------------------
------------------------------
Jeevan R
------------------------------