01: /* *****************************************************************************
02: * Authentication.java
03: * ****************************************************************************/
04:
05: /* J_LZ_COPYRIGHT_BEGIN *******************************************************
06: * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
07: * Use is subject to license terms. *
08: * J_LZ_COPYRIGHT_END *********************************************************/
09:
10: package org.openlaszlo.auth;
11:
12: import java.util.*;
13: import javax.servlet.http.*;
14:
15: public interface Authentication {
16: /**
17: * Initializer.
18: * @param prop properties passed down from lps.properties
19: */
20: void init(Properties prop) throws AuthenticationException;
21:
22: /**
23: * @return username or null if session is invalid
24: */
25: String getUsername(HttpServletRequest req, HttpServletResponse res,
26: HashMap param) throws AuthenticationException;
27:
28: /**
29: * @param req use to get request headers
30: * @param res use to get response headers
31: * @param param authparams
32: * @param xmlResponse xml response string to send back to client
33: * @return success, failure, error status code
34: */
35: int login(HttpServletRequest req, HttpServletResponse res,
36: HashMap param, StringBuffer xmlResponse)
37: throws AuthenticationException;
38:
39: /**
40: * @param req use to get request headers
41: * @param res use to get response headers
42: * @param param authparams
43: * @param xmlResponse xml response string to send back to client
44: * @return success, failure, error status code
45: */
46: int logout(HttpServletRequest req, HttpServletResponse res,
47: HashMap param, StringBuffer xmlResponse)
48: throws AuthenticationException;
49: }
|