How can I base64 encode a client ID and client secret in the Application Registry?

Popat420
Tera Expert

Hi all,

 

I have setup an Application Registry record in ServiceNow along with Connection and Credential Alias. 

But for this specific integration it is required the client id and client secret are base64 encoded, so how can I do this please? Can this be done via the Oauth API script field option in the app registry record?

When I test with Postman I use the base64 encoded client id secret in the Authorisation header,

 

Screenshot 2023-11-14 at 16.57.51 copy.png

 

Thanks in advance. 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

You can try something from thread to pass the client id and secret value. Also, check link once.

 

View solution in original post

14 REPLIES 14

Jaspal Singh
Mega Patron
Mega Patron

Hi,

You can try something from thread to pass the client id and secret value. Also, check link once.

 

Thanks @Jaspal Singh but this does not help in my use case of using it with application registry

JAmos
Tera Expert

The syntax can even be simplified a bit from what is provided in those threads using the convenience function exposed via the GlideSystem variable, gs.

var base64Val = gs.base64Encode(clientId + ':' + clientSecret);

 

https://developer.servicenow.com/dev.do#!/reference/api/vancouver/server/no-namespace/c_GlideSystemS...

Thanks @JAmos but where do I use this script if I am using application registry and connection and credentials?