Help Needed : GlideEncrypter API Deprecated & not permitted beginning with the Xanadu release
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 01:01 AM
Hi All,
We are using GlideEncrypter API to Generate Password .
As per the KB article mentioned by ServiceNow, it says all about how to use alternatives for password2 field.
I wanted to update my script include with proper alternatives . Can somebody please help me how can i use alternative of GlideEncrypter api to generate password.
var Generate_password = Class.create();
Generate_password.prototype = {
initialize: function() {
},
//var password='';
encrypt : function(){
var password = this._randomString(12, '0123456789abcdefghijlkmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ@!&*#?');
return password;
},
_randomString: function(length, chars) {
var result = '';
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
var encpwd = new GlideEncrypter();
var encpwd2 = encpwd.encrypt(result);
var decryptpwd = encpwd.decrypt(encpwd2);
return encpwd2+":"+decryptpwd;
},
type: 'Generate_password'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 01:11 AM
Everything you need is in here: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1320986
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 01:23 AM
This KB article talks about only setting the value to the password2 field but not how to use it to generate password.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 01:29 AM
Hello,
Perhaps this helps:
- 2024-01-15 - Article - GlideEncrypter API not permitted beginning with the Xanadu release
And good to know, not Xanadu anymore:
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 09:56 PM
Please look at OOB Script Include ScopedEncrypter as an example it is using Key Management Framework as mentioned in KB Article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1320986
1. You can either use OOB ScopedEncrypter or
2. Create new Script Include and create a new KMF module.
Hope this helps.