01: // @(#)SessionAuthenticator.java 1.8 "@(#)SessionAuthenticator.java 1.8 99/10/10 Sun Microsystems"
02:
03: package com.sun.portal.netlet.eproxy;
04:
05: import java.util.logging.Logger;
06:
07: import com.iplanet.sso.SSOToken;
08: import com.iplanet.sso.SSOTokenManager;
09: import com.sun.portal.log.common.PortalLogger;
10:
11: public class SessionAuthenticator {
12:
13: // private static Logger logger =
14: // Logger.getLogger("com.sun.portal.sra.netlet");
15: private static Logger logger = PortalLogger
16: .getLogger(SessionAuthenticator.class);
17:
18: public int authenticate(SessionRequest req) {
19: int rc = 0;
20:
21: try {
22:
23: SSOTokenManager manager = SSOTokenManager.getInstance();
24: SSOToken token = manager.createSSOToken(req.getSessionID());
25: if (!manager.isValidToken(token)) {
26: // logger.info("Netlet: session expired");
27: logger.info("PSSRNTLT_CSPNEPROX043");
28: rc = 1;
29: }
30: } catch (Exception e) {
31: rc = 1;
32: }
33:
34: return rc;
35: }
36:
37: public int check(SessionRequest req) {
38: int rc = 0;
39:
40: try {
41: SSOTokenManager manager = SSOTokenManager.getInstance();
42: SSOToken token = manager.createSSOToken(req.getSessionID());
43: if (!manager.isValidToken(token)) {
44: // logger.info("Netlet: session expired");
45: logger.info("PSSRNTLT_CSPNEPROX044");
46: rc = 1;
47: }
48: } catch (Exception e) {
49: rc = 1;
50: }
51:
52: return (rc);
53: }
54: }
|