3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.usermanager;
12 import java.util.List;
16 import org.opendaylight.controller.sal.authorization.AuthResultEnum;
17 import org.opendaylight.controller.sal.authorization.UserLevel;
18 import org.opendaylight.controller.sal.utils.Status;
19 import org.opendaylight.controller.usermanager.internal.AuthorizationConfig;
20 import org.opendaylight.controller.usermanager.internal.ServerConfig;
21 import org.opendaylight.controller.usermanager.internal.UserConfig;
22 import org.springframework.security.core.userdetails.UserDetailsService;
23 import org.springframework.security.web.context.SecurityContextRepository;
26 * The Interface which describes the methods exposed by User Manager.
28 public interface IUserManager extends UserDetailsService {
31 * Returns the list of roles associated to the passed user name
34 * @return the role associated to the user name
36 public List<String> getUserRoles(String userName);
39 * Authenticate user with AAA server and return authentication and authorization info
41 * @param username the username
42 * @param password the password
43 * @return {@link org.opendaylight.controller.sal.authorization.AuthResultEnum authenticate result}
45 public AuthResultEnum authenticate(String username, String password);
48 * Add/remove AAA server
50 * @param configObject refer to {@link org.opendaylight.controller.usermanager.internal.ServerConfig ServerConfig}
53 public Status addAAAServer(ServerConfig configObject);
58 * @param configObject refer to {@link org.opendaylight.controller.usermanager.internal.ServerConfig ServerConfig}
61 public Status removeAAAServer(ServerConfig configObject);
66 * @param configObject refer to {@link org.opendaylight.controller.usermanager.internal.UserConfig UserConfig}
69 public Status addLocalUser(UserConfig configObject);
74 * @param configObject refer to {@link org.opendaylight.controller.usermanager.internal.UserConfig UserConfig}
77 public Status removeLocalUser(UserConfig configObject);
82 * @param userName the user name
83 * @return the status of this action
85 public Status removeLocalUser(String userName);
88 * Add the authorization information for a user that gets authenticated remotely
93 public Status addAuthInfo(AuthorizationConfig AAAconf);
96 * Remove the authorization information for a user that gets authenticated remotely
101 public Status removeAuthInfo(AuthorizationConfig AAAconf);
104 * Return the list of authorization resources
107 public List<AuthorizationConfig> getAuthorizationList();
110 * Returns a list of AAA Providers.
111 * @return Set of provider names.
113 public Set<String> getAAAProviderNames();
116 * Change the current password for a configured user
119 * @param curPasssword
123 public Status changeLocalUserPassword(String user, String curPassword,
127 * Return a list of AAA servers currently configured
129 * @return list of {@link org.opendaylight.controller.usermanager.internal.ServerConfig ServerConfig}
131 public List<ServerConfig> getAAAServerList();
134 * Return a list of local users
136 * @return list of {@link org.opendaylight.controller.usermanager.internal.UserConfig UserConfig}
138 public List<UserConfig> getLocalUserList();
141 * Save the local users to local disk
143 * @return status code
145 public Status saveLocalUserList();
148 * Save the AAA server configurations to local disk
150 * @return status code
152 public Status saveAAAServerList();
155 * Save the Authorization configurations to local disk
157 * @return status code
159 public Status saveAuthorizationList();
162 * Remove user profile when user logs out
164 * @param username the user name
166 public void userLogout(String username);
169 * Remove user profile when user times out
171 * @param username the user name
173 public void userTimedOut(String username);
176 * Get the list of users currently logged in
178 * @return the list of users along with their administrative roles
180 public Map<String, List<String>> getUserLoggedIn();
183 * Get date and time user was successfully authenticated
186 * @return Date in String format
188 public String getAccessDate(String user);
191 * Returns the user level for the passed user name
192 * It check the roles assigned to this user and checks
193 * against the well known Controller user roles to
194 * determines the highest user level associated with
197 * @param userName the user name
198 * @return the highest user level for this user
200 public UserLevel getUserLevel(String userName);
202 // For internal use. Place holder to move securityContext storage.
203 public SecurityContextRepository getSecurityContextRepo();
205 // Session manager to implement session mgmt across web-apps
206 public ISessionManager getSessionManager();
209 public String getPassword(String username);