- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 04:57 AM
I am trying to get the encrypted "secret_key" out of an AWS Credential without success.
I have tried reading via "GlideRecord" and then using "rec.secret_key.getDecryptedValue()" but this returns the still encrypted value. This is all in "global" scope at the moment.
Is there any setup required like:
- Cryptographic Modules - I see a "com_glide_record_glideencrypter" which is "Published"
- Module Access Policy - there isn't one linked to that module - nor can I create one - shows "invalid reference"
What am I missing?
Plus - I have tried to use "sn_credential.CredentialsAccessor" as flagged in this forum post. However I am getting '"sn_credential" is not defined.' As per my reply in that thread - I am unclear if:
a) this is an installable plugin - no reference in Application Manager
b) if it handles AWS Credential.
I have my script running using "password 2" System property - which does return a decrypted value - but would prefer to use the "AWS Credential" approach.
Thanks
David
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 06:44 AM - edited 06-05-2025 07:16 AM
I have found that using "sn_cc.StandardCredentialsProvider" works for this.
var provider = new sn_cc.StandardCredentialsProvider();
var credential = provider.getCredentialByID(credrec.sys_id);
var secret_key = credential.getAttribute("secret_key");
gs.info('Secret Key ['+secret_key+']');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 06:44 AM - edited 06-05-2025 07:16 AM
I have found that using "sn_cc.StandardCredentialsProvider" works for this.
var provider = new sn_cc.StandardCredentialsProvider();
var credential = provider.getCredentialByID(credrec.sys_id);
var secret_key = credential.getAttribute("secret_key");
gs.info('Secret Key ['+secret_key+']');