Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

System Template

auth.test()

Look for and if present validate the HTTP authenication information

Syntax

void = rb.security.auth.test(community)

Parameters

The 'auth.test' method takes 1 parameter:

Name Type/Value Range/Length Description
communitystring  Required. The name of the community against which the authentication parameters should be validated.

Results

The 'auth.test' method returns no useful information.

Remarks

This method causes the Presentation Engine to look for an HTTP authentication header from the client browser. If present the username and password are removed and passed to the contact template

The results of the authentication are then used to initialise the values returned by the other methods in this object.

The validation behaviour of this method is identical to that exhibited by the rb:authentication tag, however this method does not cause an authentication failure to be sent to the browser (the tag does).

This method allows an application to see whether a user name and password have been provided by the application and if they have whether they match a valid combination in the contact template.

If the Pattern Page has neither executed this method (rb.security.auth.test) or included an rb:authentication tag then the value of rb.security.auth.status will return AuthNotTested

Example

rb.security.auth.test();

var auth=rb.security.auth.status();
switch (auth) {
case "AuthNotPresent":
   // No user name or password provided.
   ....
   break;
case "AuthOK":
   // Both provided and validated against the contact info.
   rb.page.write("pagecontents...........");
   break;
case "AuthFailed":
   // Provided - but invalid.
   rb.page.write("You are not authorised to access this page.");
   break;
}
Whitebeam release 1.3.36
(loadtime : 67ms)