01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.clientapp;
18:
19: import javax.servlet.http.HttpServletRequest;
20:
21: import edu.iu.uis.eden.web.UserLoginFilter;
22: import edu.iu.uis.eden.web.WebAuthenticationService;
23: import edu.iu.uis.eden.web.session.UserSession;
24:
25: /**
26: * Class that extracts the networkid of the user from request using the request attribute
27: * "_currentWorkflowUser". This class is used so that applications using embedded workflow
28: * can easily tell the embedded workflow web layer which user is logged in when using the
29: * {@link UserLoginFilter} in the application web app to construct the workflow session object.
30: *
31: * The {@link UserLoginFilter} constructs the {@link UserSession} object used by workflow and
32: * contacts the implemented {@link WebAuthenticationService} to get the currently logged in
33: * user.
34: *
35: * This simple implementation could be replaced by another auth service that went against
36: * an institution specific implementation.
37: *
38: * @author rkirkend
39: */
40: public class SimpleWebAuthenticationService implements
41: WebAuthenticationService {
42:
43: public static String LOGGED_IN_USER_REQUEST_ATT_KEY = "__CURRENTLY_LOGGED_IN_USER";
44:
45: public String getNetworkId(HttpServletRequest request) {
46: return (String) request
47: .getAttribute(LOGGED_IN_USER_REQUEST_ATT_KEY);
48: }
49:
50: public UserSession updateUserSession(UserSession userSession,
51: HttpServletRequest request) {
52: return userSession;
53: }
54: }
|