How can I get login user userId and password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 12:19 AM
Can anyone help me? I stuck over a situation where I need to get login user password and user id .I can able to get the user Id by using the following code .But I cant able to get password of the login user. Servicenow does not display the user password in the sys_user table.If sys_user does not contain the user password so where actually the password remain store.Plz help me.
i am using the following code
var userDetail=new GlideRecord('sys_user');
userDetail.addQuery('sys_id',userId);
userDetail.query();
while(userDetail.next())
{
var userName=userDetail.user_name;
var password=userDetail.user_password;
}
Thanx
Soumen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 12:36 AM
You can never get password of a login user. Password always save in encrypted form in user table. No one can access the password. If you try with Glide Record then it will give you only encrypted value, which has no use for you.
For logged in user you can go to left nav -->user administration-->logged in users
~Paramveer Singh
~Senior Developer
Please mark Helpful, Like, or Correct Answer if applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 12:39 AM
Its encrypted so you cant have access to password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 12:39 AM
You won't be able to get the password for the user. It's stored in sys_user but, I believe, is a one-way encrypted string. In other words, when a user logs on and verifies the password internally, the password entered is re-encrypted and compared against the encrypted password string. If they match, it's the same password. However, there's no way to get the plain text version of the password within the system.
You shouldn' t ever require the user password. If the user password needs resetting, then type over the password field and save the record (also ticking the change password on login). If the requirement is an integration, set up a common source of authentication such as LDAP. If you need to have an integration log in to the ServiceNow instance, use the Basic authentication token over a user/password string. This is an encoded string that you can get through the REST web services explorer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2023 05:46 AM
hi , I am looking for user name and password for servicenow for integration connection webhook from Docusign. As i don't have userid and password how to do that basic authentication?
