Protomatter Classes v1.1.6

com.protomatter.util
Class BasicAuthUtil

java.lang.Object
  |
  +--com.protomatter.util.BasicAuthUtil

public class BasicAuthUtil
extends java.lang.Object

A utility class that provides methods for checking and requiring basic authentication in servlets.


Method Summary
static java.lang.String getAuthPassword(javax.servlet.http.HttpServletRequest request)
          Decodes the "Authorization" header and retrieves the password from it.
static java.lang.String getAuthUsername(javax.servlet.http.HttpServletRequest request)
          Decodes the "Authorization" header and retrieves the user's name from it.
static void requireAuthentication(java.lang.String realm, javax.servlet.http.HttpServletResponse resp)
          Sends coprrect headers to require basic authentication for the given realm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAuthUsername

public static java.lang.String getAuthUsername(javax.servlet.http.HttpServletRequest request)
Decodes the "Authorization" header and retrieves the user's name from it. Returns null if the header is not present.

getAuthPassword

public static java.lang.String getAuthPassword(javax.servlet.http.HttpServletRequest request)
Decodes the "Authorization" header and retrieves the password from it. Returns null if the header is not present.

requireAuthentication

public static void requireAuthentication(java.lang.String realm,
                                         javax.servlet.http.HttpServletResponse resp)
                                  throws java.io.IOException
Sends coprrect headers to require basic authentication for the given realm.

Protomatter Classes v1.1.6
Copyright 1998-2001 Nate Sammons

Protomatter Classes v1.1.6 http://protomatter.sourceforge.net/1.1.6