public class AuthenticationException
extends java.lang.Exception
AuthenticationException is thrown when authenticating and the
provided Agent user name and/or password are incorrect or the authentication
fails due to an exception thrown by the used authentication framework.
Usually no message is provided to prevent information on how to get the
authentication and thus improve the chance to authenticate illegitimately. AuthenticationException should check
for whether this is possibly caused by an authentication attack and if so,
they should take countermeasures, for instance waiting for several time
before allowing the next authentication. However, only one service in the
stack should take countermeasures, therefore this service should
reset the flag for countermeasures.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
countMeasReq
Whether countermeasures should been taken for this authentication
exception.
|
protected boolean |
possibleAttack
Whether this authentication exception is caused by wrong authentication
data and therefore countermeasures may be required to prevent
authentication attacks.
|
| Constructor and Description |
|---|
AuthenticationException()
Constructs a new
AuthenticationException with
null as detail message and the authentication being a possible
attack. |
AuthenticationException(boolean possibleAttack)
Constructs a new
AuthenticationException with
null as detail message. |
AuthenticationException(java.lang.String msg,
boolean possibleAttack)
Creates a new
AuthenticationException having the designated
message. |
AuthenticationException(java.lang.String msg,
java.lang.Throwable cause)
Creates a new
AuthenticationException having the designated
message and cause and not being a possible attack. |
AuthenticationException(java.lang.Throwable cause,
boolean possibleAttack)
Creates a new
AuthenticationException having the designated
cause. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
counterMeasuresRequired()
Whether this authentication exception has been raised due to wrong
authentication data and thus be due to an authentication attack and
therefore counter measures (e.g. an increased wait time before the next
authentication try) should be taken.
|
void |
counterMeasuresTaken()
Whether counter measures have been taken.
|
boolean |
isPossibleAttack()
Whether this authentication exception has been raised due to wrong
authentication data and thus be due to an authentication attack.
|
protected final boolean possibleAttack
the corresponding flag.protected boolean countMeasReq
public AuthenticationException()
AuthenticationException with
null as detail message and the authentication being a possible
attack.public AuthenticationException(boolean possibleAttack)
AuthenticationException with
null as detail message.possibleAttack - Whether the exception is possibly an attack. This
sets the corresponding flags.public AuthenticationException(java.lang.String msg,
boolean possibleAttack)
AuthenticationException having the designated
message.msg - Information on the occurred exception.possibleAttack - Whether the exception is possibly an attack. This
sets the corresponding flags.public AuthenticationException(java.lang.Throwable cause,
boolean possibleAttack)
AuthenticationException having the designated
cause. This is used for wrapping an exception stemming from JAAS or another
used authentication framework.possibleAttack - Whether the exception is possibly an attack. This
sets the corresponding flags.cause - The cause for the AuthenticationException.public AuthenticationException(java.lang.String msg,
java.lang.Throwable cause)
AuthenticationException having the designated
message and cause and not being a possible attack. This is used for
wrapping an exception stemming from JAAS or another used authentication
framework.msg - Information on the occurred exception.cause - The cause for the AuthenticationException.public boolean isPossibleAttack()
public boolean counterMeasuresRequired()
public void counterMeasuresTaken()