| java.lang.Object com.caucho.server.security.AbstractAuthenticator com.caucho.server.security.JdbcAuthenticator
All known Subclasses: com.caucho.http.security.JdbcAuthenticator,
JdbcAuthenticator | public class JdbcAuthenticator extends AbstractAuthenticator (Code) | | An authenticator using JDBC.
The default table schema looks something like:
CREATE TABLE LOGIN (
username VARCHAR(250) NOT NULL,
password VARCHAR(250),
cookie VARCHAR(250),
PRIMARY KEY (username)
);
<authenticator url="jdbc:database=jdbc/user">
</authenticator>
|
Method Summary | |
protected void | addAuthCookie(HttpServletRequest request, HttpServletResponse response, ServletContext application, Principal user) Adds a cookie to store authentication. | public Principal | authenticateCookie(String cookieValue) Authenticate based on a cookie. | public String | getCookieAuthQuery() Gets the cookie auth query. | public String | getCookieAuthUpdate() Gets the cookie update query. | public String | getCookieDomain() Returns the domain for a login cookie. | public long | getCookieMaxAge() Returns the max-age for a login cookie. | public int | getCookieVersion() Returns the version for a login cookie. | public DataSource | getDataSource() | protected String | getDigestPassword(HttpServletRequest request, HttpServletResponse response, ServletContext application, String username, String realm) Returns the password for authenticators too lazy to calculate the
digest. | public String | getPasswordQuery() Gets the password query. | public String | getRoleQuery() Gets the role query. | public boolean | getUseCookie() Returns true if Resin should generate the resinauth cookie by default. | protected Principal | getUserPrincipalImpl(HttpServletRequest request, ServletContext application) | public void | init() Initialize the authenticator. | public boolean | isUserInRole(HttpServletRequest request, HttpServletResponse response, ServletContext application, Principal principal, String role) | public Principal | loginImpl(HttpServletRequest request, HttpServletResponse response, ServletContext application, String username, String password) Authenticates the user given the request. | public Principal | loginImpl(String username, String password) Authenticates the user given the request. | public void | logout(HttpServletRequest request, HttpServletResponse response, ServletContext application, Principal user) Logs the user out from the session. | public void | setCookieAuthQuery(String query) Sets the cookie auth query. | public void | setCookieAuthUpdate(String query) Sets the cookie update query. | public void | setCookieDomain(String cookieDomain) Sets the domain for a login cookie. | public void | setCookieLogout(boolean cookieLogout) | public void | setCookieMaxAge(Period cookieMaxAge) Sets the max age for a login cookie. | public void | setCookieVersion(int version) Sets the version for a login cookie. | public void | setDataSource(DataSource dataSource) Sets the database pool name. | public void | setPasswordQuery(String query) Sets the password query. | public void | setRoleQuery(String query) Sets the role query. | public void | setUseCookie(boolean useCookie) Set true if Resin should generate the resinauth cookie by default. | public boolean | updateCookie(Principal user, String cookieValue) Associates a user with a persistent cookie.
Parameters: user - the user for the cookie Parameters: cookieValue - the value of the resin-auth cookie true if the cookie value is valid, i.e. |
_cookieMaxAge | protected long _cookieMaxAge(Code) | | |
_cookieVersion | protected int _cookieVersion(Code) | | |
_useCookie | protected boolean _useCookie(Code) | | |
authenticateCookie | public Principal authenticateCookie(String cookieValue) throws ServletException(Code) | | Authenticate based on a cookie.
Parameters: cookieValue - the value of the resin-auth cookie the user for the cookie. |
getCookieAuthQuery | public String getCookieAuthQuery()(Code) | | Gets the cookie auth query.
|
getCookieAuthUpdate | public String getCookieAuthUpdate()(Code) | | Gets the cookie update query.
|
getCookieDomain | public String getCookieDomain()(Code) | | Returns the domain for a login cookie.
|
getCookieMaxAge | public long getCookieMaxAge()(Code) | | Returns the max-age for a login cookie.
|
getCookieVersion | public int getCookieVersion()(Code) | | Returns the version for a login cookie.
|
getPasswordQuery | public String getPasswordQuery()(Code) | | Gets the password query.
Example:
SELECT password FROM LOGIN WHERE username=?
|
getRoleQuery | public String getRoleQuery()(Code) | | Gets the role query.
|
getUseCookie | public boolean getUseCookie()(Code) | | Returns true if Resin should generate the resinauth cookie by default.
|
loginImpl | public Principal loginImpl(String username, String password) throws ServletException(Code) | | Authenticates the user given the request.
Parameters: username - the user name for the login Parameters: password - the password for the login the authenticated user or null for a failure |
setCookieAuthQuery | public void setCookieAuthQuery(String query)(Code) | | Sets the cookie auth query.
|
setCookieAuthUpdate | public void setCookieAuthUpdate(String query)(Code) | | Sets the cookie update query.
|
setCookieDomain | public void setCookieDomain(String cookieDomain)(Code) | | Sets the domain for a login cookie.
|
setCookieLogout | public void setCookieLogout(boolean cookieLogout)(Code) | | If true, the cookie is removed on logout
|
setCookieMaxAge | public void setCookieMaxAge(Period cookieMaxAge)(Code) | | Sets the max age for a login cookie.
|
setCookieVersion | public void setCookieVersion(int version)(Code) | | Sets the version for a login cookie.
|
setDataSource | public void setDataSource(DataSource dataSource)(Code) | | Sets the database pool name.
|
setPasswordQuery | public void setPasswordQuery(String query)(Code) | | Sets the password query.
|
setRoleQuery | public void setRoleQuery(String query)(Code) | | Sets the role query.
|
setUseCookie | public void setUseCookie(boolean useCookie)(Code) | | Set true if Resin should generate the resinauth cookie by default.
|
updateCookie | public boolean updateCookie(Principal user, String cookieValue)(Code) | | Associates a user with a persistent cookie.
Parameters: user - the user for the cookie Parameters: cookieValue - the value of the resin-auth cookie true if the cookie value is valid, i.e. it's unique |
Methods inherited from com.caucho.server.security.AbstractAuthenticator | public void addRoleMapping(Principal principal, String role)(Code)(Java Doc) protected byte[] digest(String value) throws ServletException(Code)(Java Doc) protected String getDigestPassword(HttpServletRequest request, HttpServletResponse response, ServletContext application, String username, String realm) throws ServletException(Code)(Java Doc) protected byte[] getDigestSecret(HttpServletRequest request, HttpServletResponse response, ServletContext application, String username, String realm, String algorithm) throws ServletException(Code)(Java Doc) public boolean getLogoutOnSessionTimeout()(Code)(Java Doc) public PasswordDigest getPasswordDigest()(Code)(Java Doc) public String getPasswordDigest(HttpServletRequest request, HttpServletResponse response, ServletContext app, String user, String password) throws ServletException(Code)(Java Doc) public String getPasswordDigestAlgorithm()(Code)(Java Doc) public String getPasswordDigestRealm()(Code)(Java Doc) public int getPrincipalCacheSize()(Code)(Java Doc) public Principal getUserPrincipal(HttpServletRequest request, HttpServletResponse response, ServletContext application) throws ServletException(Code)(Java Doc) protected Principal getUserPrincipalImpl(HttpServletRequest request, ServletContext application) throws ServletException(Code)(Java Doc) public void init() throws ServletException(Code)(Java Doc) public boolean isUserInRole(HttpServletRequest request, HttpServletResponse response, ServletContext application, Principal user, String role) throws ServletException(Code)(Java Doc) public Principal login(HttpServletRequest request, HttpServletResponse response, ServletContext app, String user, String password) throws ServletException(Code)(Java Doc) public Principal loginDigest(HttpServletRequest request, HttpServletResponse response, ServletContext app, String user, String realm, String nonce, String uri, String qop, String nc, String cnonce, byte[] clientDigest) throws ServletException(Code)(Java Doc) public Principal loginDigestImpl(HttpServletRequest request, HttpServletResponse response, ServletContext app, String user, String realm, String nonce, String uri, String qop, String nc, String cnonce, byte[] clientDigest) throws ServletException(Code)(Java Doc) protected Principal loginImpl(HttpServletRequest request, HttpServletResponse response, ServletContext application, String user, String password) throws ServletException(Code)(Java Doc) public void logout(ServletContext application, HttpSession timeoutSession, String sessionId, Principal user) throws ServletException(Code)(Java Doc) public void logout(HttpServletRequest request, HttpServletResponse response, ServletContext application, Principal user) throws ServletException(Code)(Java Doc) public void logout(ServletContext application, String sessionId, Principal user) throws ServletException(Code)(Java Doc) public void setLogoutOnSessionTimeout(boolean logout)(Code)(Java Doc) public void setPasswordDigest(PasswordDigest digest)(Code)(Java Doc) public void setPasswordDigestAlgorithm(String digest)(Code)(Java Doc) public void setPasswordDigestRealm(String realm)(Code)(Java Doc) public void setPrincipalCacheSize(int size)(Code)(Java Doc) public void setSerializationHandle(Object handle)(Code)(Java Doc) protected byte[] stringToDigest(String digest)(Code)(Java Doc) public String toString()(Code)(Java Doc) public Object writeReplace()(Code)(Java Doc)
|
|
|