Home > Domino Tips > Developer > HTML > Domino and user authentication
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

HTML

Domino and user authentication


Ralph Bacon
09.14.2004
Rating: -4.44- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This tip details the method I've used to prevent intranet users in a Domino environment from being prompted to enter their name and password multiple times when attempting to access a database to which they do not have permission.

Your environment

You are running IBM Lotus Domino as the back-end server for your intranet (or browser-accessible application). You have defined an ACL on a database that gives certain users rights; some users can edit, other can read, others are blocked entirely.

Incidentally, you cannot use "anonymous" as an ACL setting (except for no access and no checkboxes ticked) if you want this tip to work. In an intranet environment, it is unlikely that you would be allowing anonymous access anyway. Even if you wanted everyone in the Domino directory to have access, you would probably use a group.

I'm assuming that your server document does not allow anonymous access -- that is, Domino will always prompt your users for a name and password (see my note on using IIS below).

The problem

A user, not named explicitly or in a group in the database's ACL, who attempts access to the application will be prompted three times by Domino for a username and password until he gets an "authorization failure" message in his browser.

[IMAGE]

This is not very useful to anyone -- even if you customize the $$ReturnAuthorizationFailure form.

Why three times? Well this appears to be your browser (Internet Explorer 5+) that does this. When a password is required, it receives a 401 response from the server. The browser then prompts you for a username and password and passes that onto the server. If it gets another 401, it just repeats the process three times (duh!), presumably in the hope you'll type a correct combination of username and password. After three times, Domino gives up.

The solution

Instead of just re-prompting users for a username and password, display a page that details the problem


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
HTML
Write HTML and JavaScript in Notes view rows and columns on the Web
Open Lotus Notes documents in Microsoft Word without coding
Trap an attachment path via the Domino file upload control field
A bevy of Notes/Domino development tips
Styling Lotus Domino Web fields
How to convert Microsoft Word or Microsoft Excel documents to HTML
An easier way to view multiple columns on the Web
How to print a form in landscape format automatically
Tip contest winner: Hide view column while being able to sort it
HTML signature maker

JavaScript for Lotus Notes Domino
JavaScript workaround fixes Lotus Notes 8.x PostOpen event issue
Write HTML and JavaScript in Notes view rows and columns on the Web
JavaScript detects Web browser type and version in Notes/Domino 8.0.2
JavaScript creates a jump box on a Lotus Notes Web form
Top 10 Lotus Notes/Domino coding and development tips of 2008
How to create dynamic JavaScript in Notes Domino without formulas
Trap an attachment path via the Domino file upload control field
Converting Lotus Notes views to XML documents using JavaScript
Mimic Lotus Notes Domino application functionality on the Web
Prevent errors on iFramed pages with JavaScript

HTML for Lotus Notes Domino
Write HTML and JavaScript in Notes view rows and columns on the Web
Open Lotus Notes documents in Microsoft Word without coding
Top 10 Lotus Notes/Domino coding and development tips of 2008
Trap an attachment path via the Domino file upload control field
Mimic Lotus Notes Domino application functionality on the Web
Top 10 Lotus Notes Domino programming and development tips of 2007
Creating a link on an HTML page to a Microsoft Word attachment in a Lotus Notes database
A bevy of Notes/Domino development tips
Top 10 Notes/Domino developer tips of 2006
Styling Lotus Domino Web fields

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


and gives them a route to correct the error -- user-friendly and avoids help desk calls.

How to do it

First, let's get the ACL right.

Here's a screen shot of how it should look:

[IMAGE]

Now open the database up in design mode.

That's all there is to it! Users with unauthorized (default) permissions get to see a pretty "Unauthorized" page, whilst authorized users don't even know they have been redirected to the true entry page of the application!

Security questions

If you're thinking that users could bypass the security on the database by book marking (or otherwise typing in a URL that goes directly to) a form or view in the database -- it won't happen. This is because the ACL on the database will prevent them and they will get the old, boring prompt for a username and password.

A word of warning, however: access rights are accumulative. So if you assign the role of "[Unauthorized]" to a generic "everyone" group, and then give other groups actual access permissions, then all groups will get the role of [Unauthorized] assigned. Better to just leave the default ACL setting with the role and all groups not having a role assigned at all.

Incidentally, the above restriction doesn't apply if you assign individuals to the ACL; this is because an individual entry overrides all group rights, even when roles have been assigned.

Using this in an IIS environment

If you use Microsoft's IIS (part of Windows 2000) as a "front-end" for all HTTP requests, then this will work just the same -- unless you allow anonymous communication between IIS and Domino (which is not recommended anyway).

In a traditional IIS/Domino setup, IIS handles all HTTP requests (initially anyway). It then passes the requests onto Domino if there is an ".nsf" in the request. Under Domino 5.x, the HTTP task doesn't even run on Domino and all communication is via a special linking module. Under Domino 6.x, the HTTP requests are augmented with some authentication information and passed to Domino as a standard HTTP message -- albeit on a port other than 80 (possibly 81 or 9080, for example).

The advantage of using IIS is that the concept of "anonymous" users has no meaning. By virtue of logging onto your Windows PC, and hence the domain or workgroup, you are "known" to Windows. That user information is what is passed to Domino. You never get prompted to input a name and (intranet) password by Domino when using IIS.

How it works

In case you're not that familiar with the inner workings of Domino, HTML and JavaScript, here is a quick rundown of how this all works.

The user attempts to launch your Web page (in an intranet, for example). He types in, say, "http://intranet/phonebook.nsf," expecting to see the phone book application.

You, the designer, have set the phonebook.nsf application to launch a navigator called WebLaunch when instigated from a browser. Domino finds the navigator, then checks to see whether you've designed a template for it. It finds the $$NavigatorTemplate for WebLaunch form, and uses that as a presentation template to show that navigator. But, because you have not added a special field called $$NavigatorBody, it never actually displays the Navigator, just the form contents (which you have cunningly designed to be user-friendly and helpful).

The form has a computed-for-display role field on it that Domino calculates before converting it to HTML. This now allows you to interrogate the form with JavaScript and extract that value. If you detect that the user has the [Unauthorized] role assigned to him, then he gets to see the (pretty) form. Otherwise he gets transparently and silently redirected to the application's true home page/starting point.

And finally...

Did you get this tip to work? It is unclear in places. I admit I'm aiming it at seasoned Domino/Web developers -- so maybe I've presumed too much.

I'd appreciate any feedback on it, good or bad, so that I can incorporate any suggestions and refine accordingly. For example, would a sample database be of use?

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Ralph Bacon. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts