- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2014 01:37 AM
In my application i have username and password field and a login button. In the OnClick event of button, im trying to authenticate the credentials from servicenow sys_user table, Is there any way to do that?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 01:47 AM
pasting here again
It was difficult to search and find your thread back to reply
Not sure if you have found the answer already. if not try below appraoch and see if it works for you ...
Create a scripted web service from where you will authenticate user.. And make your of the below script .. guess it should fit your case .. let me now if it works for you
try
{
var userName = request.user_name;
var userPassword = request.user_password;
var user = GlideUser;
var authed = user.authenticate(userName,userPassword);
if(authed)
{
response.isValid = 'Valid User';
}
else
{
response.isValid = 'Invalid User';
}
}
catch(e)
{
response.isValid = "Error While Authenticating:"+e;
}
I was able to do it successfully on demo.. So works atleast on demo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 01:47 AM
pasting here again
It was difficult to search and find your thread back to reply
Not sure if you have found the answer already. if not try below appraoch and see if it works for you ...
Create a scripted web service from where you will authenticate user.. And make your of the below script .. guess it should fit your case .. let me now if it works for you
try
{
var userName = request.user_name;
var userPassword = request.user_password;
var user = GlideUser;
var authed = user.authenticate(userName,userPassword);
if(authed)
{
response.isValid = 'Valid User';
}
else
{
response.isValid = 'Invalid User';
}
}
catch(e)
{
response.isValid = "Error While Authenticating:"+e;
}
I was able to do it successfully on demo.. So works atleast on demo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 01:49 AM
create the input and output parameters for web service as below
Input:
user_name
user_password
Output:
isValid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 02:06 AM
Hai Kalaiarasan,
Perfect Answer
Thanks,
Vishnu Raj