public abstract class

AuthenticationException

extends RuntimeException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ org.springframework.security.core.AuthenticationException
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Abstract superclass for all exceptions related to an Authentication object being invalid for whatever reason.

Summary

Public Constructors
AuthenticationException(String msg, Throwable t)
Constructs an AuthenticationException with the specified message and root cause.
AuthenticationException(String msg)
Constructs an AuthenticationException with the specified message and no root cause.
AuthenticationException(String msg, Object extraInformation)
This constructor is deprecated. Use the exception message or use a custom exception if you really need additional information.
Public Methods
void clearExtraInformation()
Authentication getAuthentication()
This method is deprecated. to avoid potential leaking of sensitive information (e.g. through serialization/remoting).
Object getExtraInformation()
This method is deprecated. Use the exception message or use a custom exception if you really need additional information.
void setAuthentication(Authentication authentication)
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public AuthenticationException (String msg, Throwable t)

Constructs an AuthenticationException with the specified message and root cause.

Parameters
msg the detail message
t the root cause

public AuthenticationException (String msg)

Constructs an AuthenticationException with the specified message and no root cause.

Parameters
msg the detail message

public AuthenticationException (String msg, Object extraInformation)

This constructor is deprecated.
Use the exception message or use a custom exception if you really need additional information.

Public Methods

public void clearExtraInformation ()

public Authentication getAuthentication ()

This method is deprecated.
to avoid potential leaking of sensitive information (e.g. through serialization/remoting).

The authentication request which this exception corresponds to (may be null)

public Object getExtraInformation ()

This method is deprecated.
Use the exception message or use a custom exception if you really need additional information.

Any additional information about the exception. Generally a UserDetails object.

Returns
  • extra information or null

public void setAuthentication (Authentication authentication)