User creation via script and sharing credentials
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:46 AM
hello Team,
I’ve created a custom table that extends the sys_user table. A user record is being generated under certain conditions via a Business Rule.
Once the user is created, I set a password programmatically and send the login credentials to the user via email.
While the password appears to be set successfully, when the user tries to log in through the ESC portal using the provided credentials, they receive an "Invalid credentials" error.
Has anyone encountered a similar issue or can offer guidance on this?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:48 AM
Hi @sunilsargam
are they using the correct user name?
Have you tried it for you as well?
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:50 AM
@sunilsargam let's assume that the password is inserted correctly, the other and only possibility would be the username, which is the User ID (user_name) and this must be strictly unique.
admin in the case below:
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:51 AM
Hello @GlideFather ,
im writing the below script and in xml i can see this value is populated. but when im trying to login, it is giving me error.
var gr = new GlideRecord("customTable");
gr.get(userSysId);
var pass = "test";
gr.user_password = pass; // Set the password field directly
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:58 AM
I guess that the password is evaluated against this value:
So you nee d to create a user account with the user_password value and that allows them to enter.
You can try it first manually:
- create a user with user_name "test.password",
- user_password set to any value you will remember,
- good practice is to set "password needs reset" to true.
Then go to incognito or another browser use the /login.do and try it
when this passes OK you will need to adjust your script to insert the User to the User table
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */