Package com.auth0.jwk

Class JwksHttpResponse

java.lang.Object
com.auth0.jwk.JwksHttpResponse

public final class JwksHttpResponse extends Object
Represents the HTTP response from a JWKS endpoint. Contains both the JSON body and the response headers.
  • Constructor Details

    • JwksHttpResponse

      public JwksHttpResponse(String body, Map<String,List<String>> headers)
      Creates a new response with body and headers.
      Parameters:
      body - the response body (JWKS JSON)
      headers - the response headers (e.g., Cache-Control)
    • JwksHttpResponse

      public JwksHttpResponse(String body)
      Creates a new response with body only (no headers).
      Parameters:
      body - the response body (JWKS JSON)
  • Method Details

    • getBody

      public String getBody()
      Returns the response body as a string (the JWKS JSON).
      Returns:
      the response body
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Returns all response headers.
      Returns:
      an unmodifiable map of header names to their values
    • getHeaderValue

      public String getHeaderValue(String name)
      Returns the first value of a response header (case-insensitive lookup).

      Example usage:

      
       String cacheControl = response.getHeaderValue("Cache-Control");
       
      Parameters:
      name - the header name (case-insensitive)
      Returns:
      the first header value, or null if not present