If you'd prefer not to futz around with templates, patUser also supports plain-vanilla HTTP authentication. In this case, the browser takes care of displaying a login box; patUser merely verifies the credentials entered by the user into that box. In order to enable this type of authentication, all you need to do is forget to connect patUser to a patTemplate object. Since patUser will not have a template to use for the login box, it will automatically fall back to using HTTP authentication. Consider the following script, which illustrates: Here's what the result might look like: ![]() Note my introduction of a new method in the script above, the setRealm() method. This method is used to set the name of the realm for HTTP authentication, and appears in the login box displayed by the browser.
blog comments powered by Disqus |