Package com.nimbusds.common.oauth2
Class MasterAccessTokenValidator.ErrorResponse
- java.lang.Object
-
- com.nimbusds.common.oauth2.MasterAccessTokenValidator.ErrorResponse
-
- Enclosing interface:
- MasterAccessTokenValidator
public static class MasterAccessTokenValidator.ErrorResponse extends Object
Bearer token error response.
-
-
Constructor Summary
Constructors Constructor Description ErrorResponse(int statusCode, String wwwAuthHeader, String bodyErrorCode, String bodyErrorDesc)
Creates a new bearer token error response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(javax.servlet.http.HttpServletResponse servletResponse)
Applies this error response to the specified HTTP servlet response.javax.ws.rs.WebApplicationException
toWebAppException()
Returns a web application exception for this error response.
-
-
-
Constructor Detail
-
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 Detail
-
toWebAppException
public javax.ws.rs.WebApplicationException toWebAppException()
Returns a web application exception for this error response.- Returns:
- The web application exception.
-
apply
public void apply(javax.servlet.http.HttpServletResponse servletResponse) throws IOException
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.
-
-