Solved

implementing Remember Me feature for UserName and password on Lotus Domino

Posted on 2008-10-16
9
1,278 Views
Last Modified: 2013-12-18
Hi,

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

Any help is appreciated.

Regards
0
Comment
Question by:ashishanand
  • 3
  • 3
  • 2
9 Comments
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 500 total points
Comment Utility
0
 

Author Comment

by:ashishanand
Comment Utility
I've had a look at it but it does not help.
Need more specific approach or example

Thanks
0
 
LVL 5

Expert Comment

by:gratex_ssd
Comment Utility
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
 
LVL 5

Expert Comment

by:gratex_ssd
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:ashishanand
Comment Utility
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
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
 

Accepted Solution

by:
ashishanand earned 0 total points
Comment Utility
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
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now