Class CDORestAuthenticationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.eclipse.emf.cdo.server.rest.CDORestException
org.eclipse.emf.cdo.server.rest.CDORestAuthenticationException
- All Implemented Interfaces:
Serializable
Reports missing or invalid authentication information at the REST boundary.
The exception always maps to HTTP 401 and carries only a safe client-visible explanation. An optional challenge is
copied to the WWW-Authenticate response header after rejecting header-injection characters.
- Author:
- Eike Stepper
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCDORestAuthenticationException(String message) Creates an authentication failure without an HTTP challenge.CDORestAuthenticationException(String message, String challenge) Creates an authentication failure with an optional HTTP authentication challenge. -
Method Summary
Modifier and TypeMethodDescriptionReturns the optional value to send in theWWW-Authenticateresponse header.Methods inherited from class CDORestException
getCode, getStatusMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CDORestAuthenticationException
Creates an authentication failure without an HTTP challenge.- Parameters:
message- a safe explanation suitable for transmission to an HTTP caller
-
CDORestAuthenticationException
Creates an authentication failure with an optional HTTP authentication challenge.- Parameters:
message- a safe explanation suitable for transmission to an HTTP callerchallenge- the value forWWW-Authenticate, ornullwhen no challenge applies- Throws:
IllegalArgumentException- if the challenge contains a carriage return or line feedNullPointerException- ifmessageisnull
-
-
Method Details
-
getChallenge
Returns the optional value to send in theWWW-Authenticateresponse header.- Returns:
- the challenge, or
nullwhen no challenge is available
-