KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > auth > Authentication


1 /* *****************************************************************************
2  * Authentication.java
3 * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.auth;
11
12 import java.util.*;
13 import javax.servlet.http.*;
14
15 public interface Authentication
16 {
17     /**
18      * Initializer.
19      * @param prop properties passed down from lps.properties
20      */

21     void init(Properties prop)
22         throws AuthenticationException;
23
24     /**
25      * @return username or null if session is invalid
26      */

27     String JavaDoc getUsername(HttpServletRequest req, HttpServletResponse res,
28                        HashMap param) throws AuthenticationException;
29
30     /**
31      * @param req use to get request headers
32      * @param res use to get response headers
33      * @param param authparams
34      * @param xmlResponse xml response string to send back to client
35      * @return success, failure, error status code
36      */

37     int login(HttpServletRequest req, HttpServletResponse res,
38               HashMap param, StringBuffer JavaDoc xmlResponse)
39         throws AuthenticationException;
40
41     /**
42      * @param req use to get request headers
43      * @param res use to get response headers
44      * @param param authparams
45      * @param xmlResponse xml response string to send back to client
46      * @return success, failure, error status code
47      */

48     int logout(HttpServletRequest req, HttpServletResponse res,
49                HashMap param, StringBuffer JavaDoc xmlResponse)
50         throws AuthenticationException;
51 }
52
Popular Tags