src/main/java/com/authlete/jaxrs/ResponseUtil.java
public static Response unauthorized(String entity, String challenge)
    {
        return builder(Status.UNAUTHORIZED, entity, MEDIA_TYPE_JSON)
                .header(HttpHeaders.WWW_AUTHENTICATE, challenge)
                .build();
    }
public static Response unauthorized(String entity, String challenge)
    {
        return builder(Status.UNAUTHORIZED, entity, MEDIA_TYPE_JSON)
                .header(HttpHeaders.WWW_AUTHENTICATE, challenge)
                .build();
    }
Create a response of {@code "401 Unauthorized"}
with the given entity formatted in
{@code "application/json;charset=UTF-8"} and
with {@code WWW-Authenticate} header having the
value specified by {@code challenge}.