Class MasterAccessTokenValidator.ErrorResponse

java.lang.Object
com.nimbusds.common.oauth2.MasterAccessTokenValidator.ErrorResponse
Enclosing interface:
MasterAccessTokenValidator

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

    Modifier and Type
    Method
    Description
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 response WWW-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

      public jakarta.ws.rs.WebApplicationException toWebAppException()
      Returns a web application exception for this error response.
      Returns:
      The web application exception.
    • apply

      public void apply(jakarta.servlet.http.HttpServletResponse servletResponse) throws IOException
      Applies this error response to the specified HTTP servlet response.
      Parameters:
      servletResponse - The HTTP servlet response. Must not be null.
      Throws:
      IOException - If the error response couldn't be written.