if (redirectURI == null)
throw new ParseException("Missing \"redirect_uri\" parameter",
OAuth2Error.INVALID_REQUEST, clientID, null, state);
ResponseType rt = ar.getResponseType();
try {
OIDCResponseTypeValidator.validate(rt);
} catch (IllegalArgumentException e) {
throw new ParseException("Unsupported \"response_type\" parameter: " + e.getMessage(),
OAuth2Error.UNSUPPORTED_RESPONSE_TYPE,
clientID, redirectURI, state);
}
// Required in OIDC, must include "openid" parameter
Scope scope = ar.getScope();
if (scope == null)
throw new ParseException("Missing \"scope\" parameter",
OAuth2Error.INVALID_REQUEST,
clientID, redirectURI, state);
if (! scope.contains(OIDCScopeValue.OPENID))
throw new ParseException("The scope must include an \"openid\" token",
OAuth2Error.INVALID_REQUEST,
clientID, redirectURI, state);
// Parse the remaining OIDC parameters
Nonce nonce = Nonce.parse(params.get("nonce"));
// Nonce required in implicit flow
if (rt.impliesImplicitFlow() && nonce == null)
throw new ParseException("Missing \"nonce\" parameter: Required in implicit flow",
OAuth2Error.INVALID_REQUEST,
clientID, redirectURI, state);
Display display;