Standard token errors:
Example HTTP response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error": "invalid_request" }
Related specifications:
352353354355356357358359
try { return JWTParser.parse(content); } catch (java.text.ParseException e) { throw new ParseException(e.getMessage(), e); } }
285286287288289290291292
try { return new URI(getGeneric(o, key, String.class)); } catch (URISyntaxException e) { throw new ParseException(e.getMessage(), e); } }
309310311312313314315316
try { return new URL(getGeneric(o, key, String.class)); } catch (MalformedURLException e) { throw new ParseException(e.getMessage(), e); } }
336337338339340341342343
return new InternetAddress(getGeneric(o, key, String.class), strict); } catch (AddressException e) { throw new ParseException(e.getMessage(), e); } }
399400401402403404405406
try { return list.toArray(new String[0]); } catch (ArrayStoreException e) { throw new ParseException("JSON object member with key \"" + key + "\" is not an array of strings"); } }
447448449450451452453454455456457
try { set.add((String)item); } catch (Exception e) { throw new ParseException("JSON object member wit key \"" + key + "\" is not an array of strings"); } } return set;
27282930313233343536
*/ public static void ensureContentType(final ContentType expected, final ContentType found) throws ParseException { if (found == null) throw new ParseException("Missing HTTP Content-Type header"); if (! expected.match(found)) throw new ParseException("The HTTP Content-Type header must be " + expected); }
4142434445464748495051
public void testParseError() throws Exception { URI redirectURI = new URI("https://example.com/in"); ResponseType rt = new ResponseType(ResponseType.Value.CODE); State state = new State("xyz"); AuthenticationErrorResponse errorResponse = new AuthenticationErrorResponse(redirectURI, OAuth2Error.ACCESS_DENIED, rt, state); HTTPResponse httpResponse = errorResponse.toHTTPResponse();
395396397398399400401402403404405
ClaimsRequest cr = new ClaimsRequest(); cr.addIDTokenClaim(new ClaimsRequest.Entry("email", ClaimRequirement.ESSENTIAL)); AuthenticationRequest authRequest = new AuthenticationRequest.Builder( new ResponseType("code"), new Scope("openid", "email"), new ClientID("123"), new URI("https://client.com/cb")).claims(cr).build(); ClaimsRequest claimsRequest = ClaimsRequest.resolve(authRequest);
6162636465666768697071
public void testResolveSimple() throws Exception { Scope scope = Scope.parse("openid"); ClaimsRequest cr = ClaimsRequest.resolve(ResponseType.parse("code"), scope); System.out.println("Claims request for scope openid: " + cr.toJSONObject());