Module iu.util.auth
Package edu.iu.auth

Class IuAuthenticationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
edu.iu.auth.IuAuthenticationException
All Implemented Interfaces:
Serializable

public class IuAuthenticationException extends Exception
Thrown by an incoming request handler to represent an authentication failure.

Should be caught and handled as 302 FOUND or 401 UNAUTHORIZED by an outbound web request boundary as appropriate to the authorization scenario and user-agent context. Should not be handled by application-layer business logic.Should not be thrown by components not directly responsible for authentication.

See Also:
  • Constructor Details

    • IuAuthenticationException

      public IuAuthenticationException(String challenge)
      Constructor.
      Parameters:
      challenge - WWW-Authenticate header value for informing the remote client of the endpoint authentication requirements.
    • IuAuthenticationException

      public IuAuthenticationException(String challenge, Throwable cause)
      Constructor.
      Parameters:
      challenge - WWW-Authenticate header value for informing the remote client of the endpoint authentication requirements.
      cause - Optional exception or error describing the authentication failure.
  • Method Details

    • getMessage

      public String getMessage()
      Gets the WWW-Authenticate header value to report to the user agent authentication failure.
      Overrides:
      getMessage in class Throwable
      Returns:
      WWW-Authenticate header value
    • getLocation

      public URI getLocation()
      Gets the Location header value for redirecting the user-agent to next step in the authentication process, if appropriate for the context; may be null if the authorization scenario doesn't specify user-agent interaction.
      Returns:
      location
    • setLocation

      public void setLocation(URI location)
      Sets the Location header value for redirecting the user-agent to next step in the authentication process, if appropriate for the context; may be null if the authorization scenario doesn't specify user-agent interaction.
      Parameters:
      location - location