Use Access Token on the header of Rest Message Call
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 08:44 AM
Hi All,
I need to set on the header of a Rest message a variable that store the AccessToken.
Now, that value is stored on the table "oauth_credential", in the field "token_received" that is a "password2" field.
I have thinked to a script that using the GlideEncrypter recover this information,
but, there are a standard way to recover the token and so use it on the Rest Call?
Regads
Vincenzo
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 09:13 AM
Hi @Vincenzo Basile ,
Try with below script
var OAuthClient = new GlideRecord('u_oauth_client');
if (OAuthClient.get('c09a2bd60fccf6008e2a4b9ce1050e56')) {
var encrypter = new GlideEncrypter();
var clientSecret = encrypter.decrypt(OAuthClient.u_secret);
gs.print(clientSecret);
}
Thanks,
Anand