Class BasicAuthServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.deltava.servlet.GenericServlet
org.deltava.servlet.BasicAuthServlet
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
- Direct Known Subclasses:
DownloadServlet
,UploadServlet
,WebServiceServlet
A servlet that supports basic HTTP authentication.
- Since:
- 1.0
- Version:
- 11.3
- Author:
- Luke
-
Nested Class Summary
Nested classes/interfaces inherited from class org.deltava.servlet.GenericServlet
GenericServlet.ForbiddenException, GenericServlet.NotFoundException, GenericServlet.ServletSecurityContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Pilot
Authenticates the current web user.protected static void
challenge
(HttpServletResponse rsp, String realm) Sets the response headers for a basic authentication challenge.Methods inherited from class org.deltava.servlet.GenericServlet
getURL
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Constructor Details
-
BasicAuthServlet
BasicAuthServlet()
-
-
Method Details
-
authenticate
Authenticates the current web user.- Parameters:
req
- the current HTTP servlet request- Returns:
- the authenticated Pilot's databse record, or null if not logged in
-
challenge
Sets the response headers for a basic authentication challenge.- Parameters:
rsp
- the HTTP servlet responserealm
- the realm name to present to the browser- Throws:
IOException
- if a network error occurs
-