Class JDBCAuthFilter

java.lang.Object
fc.web.servlet.AuthFilter
fc.web.servlet.JDBCAuthFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class JDBCAuthFilter extends AuthFilter
Implements a simple jdbc based authentication filter. Uses JDBCSession to check for the valid existence of the session ID. The session ID itself is expected to be inside a cookie (the presence of a cookie is checked by invoking LoginServlet.getSIDCookie(HttpServletRequest)

Uses the default database as specified in web.xml and requires JDBCSession to work against that database.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(jakarta.servlet.FilterConfig config)
     
    boolean
    isUserLoggedIn(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res)
    Checks to see if the session id (sid) exists in the cookie and it that points to a valid (non-expired) database session.

    Methods inherited from class AuthFilter

    destroy, doFilter

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig config) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Filter
      Overrides:
      init in class AuthFilter
      Throws:
      jakarta.servlet.ServletException
    • isUserLoggedIn

      public boolean isUserLoggedIn(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws SQLException
      Checks to see if the session id (sid) exists in the cookie and it that points to a valid (non-expired) database session.
      Specified by:
      isUserLoggedIn in class AuthFilter
      Throws:
      SQLException