@SuppressWarnings("unchecked")
public static Map<String, Object> verify(String audience, String assertion) throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("audience", audience);
params.put("assertion", assertion);
Request req = Request.create(VerifyURL, METHOD.POST, params);
Response resp = Sender.create(req).send();
if (resp.getStatus() != 200) {
throw new RuntimeException("server resp code != 200");
}
return Json.fromJson(Map.class, Streams.utf8r(resp.getStream()));