01: /*
02: * Copyright 2005-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.acegisecurity.providers.portlet;
18:
19: import org.acegisecurity.Authentication;
20: import org.acegisecurity.AuthenticationException;
21: import org.acegisecurity.userdetails.UserDetails;
22:
23: /**
24: * Populates the <code>UserDetails</code> associated with the
25: * portlet user presented by the portlet container.
26: *
27: * @author John A. Lewis
28: * @since 2.0
29: * @version $Id$
30: */
31: public interface PortletAuthoritiesPopulator {
32:
33: //~ Methods ========================================================================================================
34:
35: /**
36: * Obtains the granted authorities for the specified Authentication object.
37: * <p>May throw any <code>AuthenticationException</code> or return <code>null</code>
38: * if the authorities are unavailable.</p>
39: * @param authentication the authentication object seeking authorities
40: * @return the details of the indicated user (at minimum the granted authorities and the username)
41: * @throws AuthenticationException if the user details are not available or the authentication is not valid for some reason
42: */
43: public UserDetails getUserDetails(Authentication authentication)
44: throws AuthenticationException;
45:
46: }
|