|
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 | community | string | | 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. 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;
}
|
|
(loadtime : 985ms) |