Source code: org/acegisecurity/BadCredentialsException.java
1 /* Copyright 2004, 2005 Acegi Technology Pty Limited
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 package org.acegisecurity;
17
18 /**
19 * Thrown if an authentication request is rejected because the credentials are
20 * invalid. For this exception to be thrown, it means the account is neither
21 * locked nor disabled.
22 *
23 * @author Ben Alex
24 * @version $Id: BadCredentialsException.java,v 1.4 2005/11/17 00:55:49 benalex Exp $
25 */
26 public class BadCredentialsException extends AuthenticationException {
27 //~ Instance fields ========================================================
28
29 private Object extraInformation;
30
31 //~ Constructors ===========================================================
32
33 /**
34 * Constructs a <code>BadCredentialsException</code> with the specified
35 * message.
36 *
37 * @param msg the detail message
38 */
39 public BadCredentialsException(String msg) {
40 super(msg);
41 }
42
43 public BadCredentialsException(String msg, Object extraInformation) {
44 super(msg);
45 this.extraInformation = extraInformation;
46 }
47
48 /**
49 * Constructs a <code>BadCredentialsException</code> with the specified
50 * message and root cause.
51 *
52 * @param msg the detail message
53 * @param t root cause
54 */
55 public BadCredentialsException(String msg, Throwable t) {
56 super(msg, t);
57 }
58
59 //~ Methods ================================================================
60
61 /**
62 * Any additional information about the exception. Generally a
63 * <code>UserDetails</code> object.
64 *
65 * @return extra information or <code>null</code>
66 */
67 public Object getExtraInformation() {
68 return extraInformation;
69 }
70 }