1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity;
17
18 /***
19 * Evaluates <code>Authentication</code> tokens
20 *
21 * @author Ben Alex
22 * @version $Id: AuthenticationTrustResolver.java,v 1.2 2005/11/17 00:55:49 benalex Exp $
23 */
24 public interface AuthenticationTrustResolver {
25
26
27 /***
28 * Indicates whether the passed <code>Authentication</code> token
29 * represents an anonymous user. Typically the framework will call this
30 * method if it is trying to decide whether an
31 * <code>AccessDeniedException</code> should result in a final rejection
32 * (ie as would be the case if the principal was non-anonymous/fully
33 * authenticated) or direct the principal to attempt actual authentication
34 * (ie as would be the case if the <code>Authentication</code> was merely
35 * anonymous).
36 *
37 * @param authentication to test (may be <code>null</code> in which case
38 * the method will always return <code>false</code>)
39 *
40 * @return <code>true</code> the passed authentication token represented an
41 * anonymous principal, <code>false</code> otherwise
42 */
43 public boolean isAnonymous(Authentication authentication);
44
45 /***
46 * Indicates whether the passed <code>Authentication</code> token
47 * represents user that has been remembered (ie not a user that has been
48 * fully authenticated).
49 *
50 * <p>
51 * <b>No part of the framework uses this method</b>, as it is a weak
52 * definition of trust levels. The method is provided simply to assist
53 * with custom <code>AccessDecisionVoter</code>s and the like that you
54 * might develop. Of course, you don't need to use this method either and
55 * can develop your own "trust level" hierarchy instead.
56 * </p>
57 *
58 * @param authentication to test (may be <code>null</code> in which case
59 * the method will always return <code>false</code>)
60 *
61 * @return <code>true</code> the passed authentication token represented a
62 * principal authenticated using a remember-me token,
63 * <code>false</code> otherwise
64 */
65 public boolean isRememberMe(Authentication authentication);
66 }