- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 03:01 AM
Hi All ,
I have to set a security disclaimer page only who logins for the first time . Beneath that page there will be 2 check boxes Accept and Decline .
1. When user will click Accept it should redirect to the Service Portal homepage.
2. If Decline it should again go back to login page.
Security disclaimer page should get set after login on Service portal page.
Version : Istanbul .
Please provide help how to achieve this .
Thanks
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2016 12:41 AM
Hey Aastha,
Let's take it stepwise:
You might find an installation exit called: Login
It basically checks the username and password and based on a match, home page redirection applies. I have modified the script as belows (change highlighted in bold):
gs.include("PrototypeServer");
var Login = Class.create();
Login.prototype = {
initialize : function() {
},
process : function() {
// the request is passed in as a global
var userName = request.getParameter("user_name");
var userPassword = request.getParameter("user_password");
var user = GlideUser;
var authed = user.authenticate(userName, userPassword);
if (authed) {
var gr = new GlideRecord("sys_user");
gr.addQuery('user_name',userName);
gr.addNullQuery("last_login_time");
gr.query();
if (gr.next()) {
gs.setRedirect("https://yourinstance/customer_service");
}
return user.getUser(userName);
}
this.loginFailed();
return "login.failed";
},
loginFailed : function() {
if (GlideController.exists("glide.ldap.error.connection")) {
var ldapConnError = GlideController.getGlobal("glide.ldap.error.connection");
if ( GlideStringUtil.notNil(ldapConnError) )
GlideSession.get().addErrorMessage(ldapConnError);
} else {
var message = GlideSysMessage.format("login_invalid");
GlideSession.get().addErrorMessage(message);
}
}
}
Here, gs.setRedirect("https://yourinstance/customer_service") is redirecting user to customer_service content site, you can have your own customer page here. Once, you are able to redirect to customer_service site, you can try creating your UI page with Custom Buttons. These custom buttons will redirect based on your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 09:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2016 12:41 AM
Hey Aastha,
Let's take it stepwise:
You might find an installation exit called: Login
It basically checks the username and password and based on a match, home page redirection applies. I have modified the script as belows (change highlighted in bold):
gs.include("PrototypeServer");
var Login = Class.create();
Login.prototype = {
initialize : function() {
},
process : function() {
// the request is passed in as a global
var userName = request.getParameter("user_name");
var userPassword = request.getParameter("user_password");
var user = GlideUser;
var authed = user.authenticate(userName, userPassword);
if (authed) {
var gr = new GlideRecord("sys_user");
gr.addQuery('user_name',userName);
gr.addNullQuery("last_login_time");
gr.query();
if (gr.next()) {
gs.setRedirect("https://yourinstance/customer_service");
}
return user.getUser(userName);
}
this.loginFailed();
return "login.failed";
},
loginFailed : function() {
if (GlideController.exists("glide.ldap.error.connection")) {
var ldapConnError = GlideController.getGlobal("glide.ldap.error.connection");
if ( GlideStringUtil.notNil(ldapConnError) )
GlideSession.get().addErrorMessage(ldapConnError);
} else {
var message = GlideSysMessage.format("login_invalid");
GlideSession.get().addErrorMessage(message);
}
}
}
Here, gs.setRedirect("https://yourinstance/customer_service") is redirecting user to customer_service content site, you can have your own customer page here. Once, you are able to redirect to customer_service site, you can try creating your UI page with Custom Buttons. These custom buttons will redirect based on your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2016 02:46 AM
Hi anurag92,
I have made changes as per your suggestions .
1. What changes I should do here ?
var gr = new GlideRecord("sys_user");
gr.addQuery('user_name',userName);
gr.addNullQuery("last_login_time");
gr.query();
if (gr.next()) {
2. Also Please let me know how to set up a UI Page . I have never created a UI Page before.
Below is the disclaimer page that should be in that UI Page.
3. Please it will be really helpful if you can provide how to create UI Page , Codes .
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2018 08:52 AM
Hi Anurag,
The solution proposed by you worked for us but this is the case where you are using portal login through 'username' and 'password'.Can you please suggest what could be done in case of sso by identity provider