2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
25 * To change this template, choose Tools | Templates
26 * and open the template in the editor.
29 package org.collectionspace.authentication.realm;
31 import java.security.acl.Group;
32 import java.util.Collection;
33 import javax.security.auth.login.LoginException;
36 * CSpaceRealm defines interface for CollectionSpace Realm
38 public interface CSpaceRealm {
41 * Obtain password for the given user
44 * @throws LoginException
46 public String getUsersPassword(String username) throws LoginException;
49 * Obtain the roles for the authenticated user.
50 * @return collection containing the roles
52 public Collection<Group> getRoles(String username, String principalClassName, String groupClassName) throws LoginException;
55 * Obtain the tenants for the authenticated user.
56 * @return collection containing the roles
58 public Collection<Group> getTenants(String username, String groupClassName) throws LoginException;