Package com.nimbusds.common.oauth2
Class MasterAccessTokenValidator.ErrorResponse
java.lang.Object
com.nimbusds.common.oauth2.MasterAccessTokenValidator.ErrorResponse
- Enclosing interface:
- MasterAccessTokenValidator
Bearer token error response.
-
Constructor Summary
ConstructorDescriptionErrorResponse
(int statusCode, String wwwAuthHeader, String bodyErrorCode, String bodyErrorDesc) Creates a new bearer token error response. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(jakarta.servlet.http.HttpServletResponse servletResponse) Applies this error response to the specified HTTP servlet response.jakarta.ws.rs.WebApplicationException
Returns a web application exception for this error response.
-
Constructor Details
-
ErrorResponse
public ErrorResponse(int statusCode, String wwwAuthHeader, String bodyErrorCode, String bodyErrorDesc) Creates a new bearer token error response.- Parameters:
statusCode
- The HTTP status code.wwwAuthHeader
- The HTTP responseWWW-Authenticate
header,null
if none.bodyErrorCode
- The error code for the body JSON object.bodyErrorDesc
- The error description for the body JSON object.
-
-
Method Details
-
toWebAppException
Returns a web application exception for this error response.- Returns:
- The web application exception.
-
apply
Applies this error response to the specified HTTP servlet response.- Parameters:
servletResponse
- The HTTP servlet response. Must not benull
.- Throws:
IOException
- If the error response couldn't be written.
-