Response tokenResponse(AuthToken token)

Transforms a AuthToken into a Response object with an RFC6749 compliant JSON token as the HTTP response body.

Source

static Response tokenResponse(AuthToken token) {
  return new Response(HttpStatus.OK,
      {"Cache-Control": "no-store", "Pragma": "no-cache"}, token.asMap());
}