op.tokenEndpointJWSAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "token_endpoint_auth_signing_alg_values_supported")) {
if (v != null && v.equals(Algorithm.NONE.getName()))
throw new ParseException("The none algorithm is not accepted");
if (v != null)
op.tokenEndpointJWSAlgs.add(new JWSAlgorithm(v));
}
}
// OpenID Connect request object
if (jsonObject.containsKey("request_object_signing_alg_values_supported")) {
op.requestObjectJWSAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "request_object_signing_alg_values_supported")) {
if (v != null)
op.requestObjectJWSAlgs.add(new JWSAlgorithm(v));
}
}
if (jsonObject.containsKey("request_object_encryption_alg_values_supported")) {
op.requestObjectJWEAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "request_object_encryption_alg_values_supported")) {
if (v != null)
op.requestObjectJWEAlgs.add(new JWEAlgorithm(v));
}
}
if (jsonObject.containsKey("request_object_encryption_enc_values_supported")) {
op.requestObjectJWEEncs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "request_object_encryption_enc_values_supported")) {
if (v != null)
op.requestObjectJWEEncs.add(new EncryptionMethod(v));
}
}
// ID token
if (jsonObject.containsKey("id_token_signing_alg_values_supported")) {
op.idTokenJWSAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "id_token_signing_alg_values_supported")) {
if (v != null)
op.idTokenJWSAlgs.add(new JWSAlgorithm(v));
}
}
if (jsonObject.containsKey("id_token_encryption_alg_values_supported")) {
op.idTokenJWEAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "id_token_encryption_alg_values_supported")) {
if (v != null)
op.idTokenJWEAlgs.add(new JWEAlgorithm(v));
}
}
if (jsonObject.containsKey("id_token_encryption_enc_values_supported")) {
op.idTokenJWEEncs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "id_token_encryption_enc_values_supported")) {
if (v != null)
op.idTokenJWEEncs.add(new EncryptionMethod(v));
}
}
// UserInfo
if (jsonObject.containsKey("userinfo_signing_alg_values_supported")) {
op.userInfoJWSAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "userinfo_signing_alg_values_supported")) {
if (v != null)
op.userInfoJWSAlgs.add(new JWSAlgorithm(v));
}
}
if (jsonObject.containsKey("userinfo_encryption_alg_values_supported")) {
op.userInfoJWEAlgs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "userinfo_encryption_alg_values_supported")) {
if (v != null)
op.userInfoJWEAlgs.add(new JWEAlgorithm(v));
}
}
if (jsonObject.containsKey("userinfo_encryption_enc_values_supported")) {
op.userInfoJWEEncs = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "userinfo_encryption_enc_values_supported")) {
if (v != null)
op.userInfoJWEEncs.add(new EncryptionMethod(v));
}
}
// Misc
if (jsonObject.containsKey("display_values_supported")) {
op.displays = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "display_values_supported")) {
if (v != null)
op.displays.add(Display.parse(v));
}
}
if (jsonObject.containsKey("claim_types_supported")) {
op.claimTypes = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "claim_types_supported")) {
if (v != null)
op.claimTypes.add(ClaimType.parse(v));
}
}
if (jsonObject.containsKey("claims_supported")) {
op.claims = new ArrayList<>();
for (String v: JSONObjectUtils.getStringArray(jsonObject, "claims_supported")) {
if (v != null)
op.claims.add(v);
}
}
if (jsonObject.containsKey("claims_locales_supported")) {
op.claimsLocales = new ArrayList<>();
for (String v : JSONObjectUtils.getStringArray(jsonObject, "claims_locales_supported")) {
if (v != null) {
try {
op.claimsLocales.add(LangTag.parse(v));
} catch (LangTagException e) {
throw new ParseException("Invalid claims_locales_supported field: " + e.getMessage(), e);
}
}
}
}
if (jsonObject.containsKey("ui_locales_supported")) {
op.uiLocales = new ArrayList<>();
for (String v : JSONObjectUtils.getStringArray(jsonObject, "ui_locales_supported")) {
if (v != null) {
try {
op.uiLocales.add(LangTag.parse(v));
} catch (LangTagException e) {
throw new ParseException("Invalid ui_locales_supported field: " + e.getMessage(), e);
}
}
}
}