Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1307
  • Last Modified:

implementing Remember Me feature for UserName and password on Lotus Domino

Hi,

How can I implement "Remember Me" functionality for web application which uses the Domino authentication.

Any help is appreciated.

Regards
0
ashishanand
Asked:
ashishanand
  • 3
  • 3
  • 2
2 Solutions
 
Sjef BosmanGroupware ConsultantCommented:
0
 
ashishanandAuthor Commented:
I've had a look at it but it does not help.
Need more specific approach or example

Thanks
0
 
gratex_ssdCommented:
do you mean single sign on feature? the main purpose is to enter your name and password only once. if you have computer in domain, and you have the same password and name for your windows account and also for your lotus notes client (lot people have), then it is automatically used (it is necessary to have installed lotus SSO service on that PC).  or you mean automatic web authentification. This can be done via Apache Tomcat authentification. http://tomcat.apache.org/ The process is, that when you open web link, e.g. http://server:8080/database.nsf, then you will be silently redirected to tomcat (which check and compare your windows login, with your lotus notes login, if ok, then this will be recorded in his DB), and if authentification succed, you may proceed. if not, then password synchronization is necessary (sometime you need to delete that synchro data for some users. that data poining on person record, and if that person record changed, it will not work. this is also a solution for non working sametime client)

is this what you are looking for?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gratex_ssdCommented:
in here is few more infos about Apache Tomcat SSO and some nice attached tutorials - http://www.360doc.com/showWeb/0/0/22640.aspx
0
 
ashishanandAuthor Commented:
I've implemented Remember Me feature in Domino using Javascript Cookies (Please refer to the code below and the attached code snippet).

I've created a custom login form. Apart from User Name and Password fields on the form, I've created a CheckBox field "Remember Me" inside a Layer.
<DIV id='RememberMeLayer'><INPUT TYPE="checkbox" NAME="RememberMe" Value="Yes">Remember Me</DIV>


OnSubmit the system checks if "Remember Me" is checked". If yes, the the cookies are set.
<form onsubmit="doSubmit();" method="post" action="/names.nsf?Login" name="_LoginForm">


The following code is put into the form's "HTML Body Attribute" object, this is to check the Remember Me cookie.
"onload=\"findObj('UserName').focus(); initCookie();\""


Hope someone can find it useful.
Please let me know if you have any issues.
function initCookie()
{
	var cookieName = 'UserNamePWD';
	var cookieValue = GetCookie(cookieName);
	if (cookieValue  != null) {
		namePwdArray = cookieValue.split('~');
		var usrName = namePwdArray[0];
		var pwd = namePwdArray[1];
	}
	if (usrName != 'Anonymous' && usrName != '' && usrName != null && pwd != '' && pwd != null) {
		findObj('UserName').value = usrName;
		findObj('Password').value = pwd;
	
		if (findObj("RememberMe") != null)
			setItemValue(findObj("RememberMe"), "Yes")
		showHideLayers('RememberMeLayer', '', 'hide')
	}
}
 
 
function doRememberMe() {
 
	var thenewdate = new Date ();
	var cookieName = 'UserNamePWD';
 
	usrName = findObj('UserName').value;
	pwd = findObj('Password').value;
	if (usrName != 'Anonymous' && usrName != '' && usrName != null && pwd != null) {
		thenewdate.setTime(thenewdate.getTime() + (365 * 24 * 3600 * 1000));
		SetCookie(cookieName, usrName + '~' + pwd, thenewdate);
	}
}
 
 
function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
 
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
 
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
	}
	return null;
}
 
 
 
 
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
 
	return unescape(document.cookie.substring(offset, endstr));
}
 
 
 
 
function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
 
	document.cookie =	name + "=" + escape (value) +
			((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
			((path == null) ? "" : ("; path=" + path)) +
			((domain == null) ? "" : ("; domain=" + domain)) +
			((secure == true) ? "; secure" : "");
}
 
 
 
 
 
function DeleteCookie(name) {
	var exp = new Date();
	var cval = GetCookie (name);
 
	FixCookieDate (exp); 
	exp.setTime (exp.getTime() - 1); 
 
	if (cval != null)
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
 
 
 
function FixCookieDate (date) {
	var base = new Date(0);
	var skew = base.getTime(); // dawn of (Unix) time - should be 0
	if (skew > 0)  // Except on the Mac - ahead of its time
		date.setTime (date.getTime() - skew);
}
 
 
 
function findObj(n, d) 
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
 
 
function showHideLayers() 
{
 var i,p,v,obj,args=showHideLayers.arguments;
 for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
   if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
   obj.visibility=v; }
}
 
 
function setItemValue(itemObject, itemValue)
{
	var itemObj = null;
	if ( itemObject.type )
		itemObj = itemObject;
	else
		itemObj = itemObject[0];
 
	var value = itemValue;
	value = value.replace(/#039/g,"'");
	value = value.replace(/#034/g,"\"");
	value = value.replace(/#999/g,"@^");
 
	if (itemObj.type.toLowerCase() == "text" || itemObj.type.toLowerCase() == "hidden"  || itemObj.type.toLowerCase() == "textarea")
	{
		itemObj.value = itemValue;
		return;	
	}
	if (itemObj.type.toLowerCase() == "checkbox" )
		setCheckBox(itemObject, itemValue);
	if (itemObj.type.toLowerCase() == "select-one" || itemObj.type.toLowerCase() == "select-multi")
		selectListBoxValue(itemObj , itemValue);
	if (itemObj.type.toLowerCase() == "radio")
		setRadioItemChecked(itemObj , itemValue);
}
 
 
function setCheckBox(obj, value)
{
	var valueArray = value.split(",");
	if(obj.length != null)
	{
		for(var i = 0; i < obj.length; i++)
		{
			if( inArray(obj[i].value, valueArray))
				obj[i].checked = true;
			else
				obj[i].checked = false;
		}
	}
	else
		if( inArray(obj.value, valueArray) )
			obj.checked = true;
		else
			obj.checked = false;
}
 
 
 
function selectListBoxValue(item, itemValue)
{
	for ( i=0; i < item.options.length ; i++)
	{
		if ( item.options[i].value == itemValue )
		{
			item.options.selectedIndex = i;
			return;
		}
	}
 
}
 
 
function setRadioItemChecked(item, itemValue)
{
	var radioItem = findObj( item.name );
 
	for ( i= 0; i < radioItem.length; i++)
	{
		if ( radioItem[i].value == itemValue )
		{
			radioItem[i].checked = true;
			return;
		}
		else
		{
			radioItem[i].checked = false;
		}
	}
}

Open in new window

0
 
Sjef BosmanGroupware ConsultantCommented:
It might be useful to someone else indeed!

And be my guest, accept your own answer. I hope the first method given in the link I posted put you on the right track.
0
 
ashishanandAuthor Commented:
With all due respect sjef_bosman, I do agree your posting was of help.

I choose to accept my own answer because it is actually the solution, and if anyone else comes across this posting I would want the person to be guided to the complete solution.

With reference to the points, is it possible to accept my solution as the correct solution and still award the points to someone who guided towards it?

Please advice.
Regards
0
 
Sjef BosmanGroupware ConsultantCommented:
No problem. It's just that I have lots of other things to do and hence no time to develop a complete solution for you. :-)

As far as I know, it is possible to accept your own solution and award points to others. How? Dunno, it should be in the page somewhere, and certainly on the EE Help page.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now