
Class AuthenticationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException
-
- ca.uhn.fhir.rest.server.exceptions.AuthenticationException
-
- All Implemented Interfaces:
Serializable
public class AuthenticationException extends BaseServerResponseException
Represents an HTTP 401 Client Unauthorized response, which means that the client needs to provide credentials, or has provided invalid credentials.For security failures, you should use
AuthenticationException
if you want to indicate that the user could not be authenticated (e.g. credential failures), also known as an authentication failure. You should useForbiddenOperationException
if you want to indicate that the authenticated user does not have permission to perform the requested operation, also known as an authorization failure.Note that a complete list of RESTful exceptions is available in the Package Summary.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
STATUS_CODE
-
Constructor Summary
Constructors Constructor Description AuthenticationException()
AuthenticationException(String theMessage)
AuthenticationException(String theMessage, Throwable theCause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationException
addAuthenticateHeaderForRealm(String theRealm)
Adds aWWW-Authenticate
header to the response, of the form:
WWW-Authenticate: Basic realm="theRealm"
-
Methods inherited from class ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException
addResponseHeader, getAdditionalMessages, getOperationOutcome, getResponseBody, getResponseHeaders, getResponseMimeType, getStatusCode, hasResponseHeaders, isErrorMessageTrusted, newInstance, setErrorMessageTrusted, setOperationOutcome, setResponseBody, setResponseMimeType
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
STATUS_CODE
public static final int STATUS_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AuthenticationException
public AuthenticationException()
-
AuthenticationException
public AuthenticationException(String theMessage)
-
AuthenticationException
public AuthenticationException(String theMessage, Throwable theCause)
-
-
Method Detail
-
addAuthenticateHeaderForRealm
public AuthenticationException addAuthenticateHeaderForRealm(String theRealm)
Adds aWWW-Authenticate
header to the response, of the form:
WWW-Authenticate: Basic realm="theRealm"
- Returns:
- Returns a reference to
this
for easy method chaining
-
-