Class UnauthorizedException

All Implemented Interfaces:
Serializable

public class UnauthorizedException extends AxiomException
A request without valid credentials (401). The response carries the caller-supplied WWW-Authenticate challenge, which must be a constant chosen by the application (for example Bearer realm="api"), never a value taken from the request.
See Also:
  • Constructor Details

    • UnauthorizedException

      public UnauthorizedException(String challenge)
      Creates the exception with code unauthorized.
      Parameters:
      challenge - WWW-Authenticate value: an auth scheme, optionally followed by a space and parameters, in visible ASCII
      Throws:
      IllegalArgumentException - for an invalid or unsafe challenge
    • UnauthorizedException

      public UnauthorizedException(String challenge, String code)
      Creates the exception with a specific safe code.
      Parameters:
      challenge - WWW-Authenticate value
      code - machine-readable code
      Throws:
      IllegalArgumentException - for an invalid or unsafe challenge