ARG645
Tera Guru
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-04-2020 11:19 AM
Please hit Like or Bookmark this article if it helps.
Use Cases: Where ever there is a need to add extra layer of authentication
Try the below script in your background script.
var userName = gs.getUserName();//Or any username say abel.tuter
var password = "July_4th_2020";
var user = GlideUser;
var authed = user.authenticate(userName, password);
gs.print(authed); //returns true or false (boolean)
Background script Outputs:
If username and password combination fails
Logging event: SNC.Auth.DB.Login.Failed with parm1: user_name=admin and parm2: remoteAddr=45.22.61.251
*** Script: false
If username and password combination is correct.
*** Script: true
Thank you,
Aman Gurram
Labels:
- 2,647 Views
Comments
Gia
Kilo Contributor
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
07-04-2020
07:52 PM
Hi Aman,
How can i use method GlideUser.authenticate in scoped applications ? it keep showing an error
ARG645
Tera Guru
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
07-08-2020
10:47 PM
Gia,
The method is only available in Global Scope. You can write a function in a script include (in Global Scope) that uses the GlideUser.authenticate and call it from your custom scope.
Thank you,
Aman Gurram