Example:
Bearer realm="example.com", error="invalid_token", error_description="Invalid access token"
154155156157158159160161162163164
// Add the WWW-Authenticate header if (error instanceof BearerTokenError) { BearerTokenError bte = (BearerTokenError)error; httpResponse.setWWWAuthenticate(bte.toWWWAuthenticateHeader()); } else { JSONObject jsonObject = new JSONObject(); if (error.getCode() != null)
125126127128129130131132133
BearerTokenError bte = (BearerTokenError)e.getErrorObject(); assertEquals(401, bte.getHTTPStatusCode()); assertNull(bte.getCode()); assertEquals("Bearer", bte.toWWWAuthenticateHeader()); } } }
323334353637383940
585960616263646566