use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class FAPICIBAAddAcrValuesToAuthorizationEndpointRequest method evaluate.
@Override
@PreEnvironment(required = "authorization_endpoint_request")
@PostEnvironment(required = "authorization_endpoint_request")
public Environment evaluate(Environment env) {
JsonObject authorizationEndpointRequest = env.getObject("authorization_endpoint_request");
String requestedACRs = env.getString("client", "acr_value");
if (requestedACRs == null) {
throw error("Couldn't find acr_value in configuration");
}
// Check provided acr_values is supported by server or not
boolean acrValueIsSupportedFlg = false;
JsonArray acrValuesSupported = env.getElementFromObject("server", "acr_values_supported").getAsJsonArray();
for (JsonElement jsonElementAcrValue : acrValuesSupported) {
if (OIDFJSON.getString(jsonElementAcrValue).equals(requestedACRs)) {
acrValueIsSupportedFlg = true;
break;
}
}
if (!acrValueIsSupportedFlg) {
throw error("Provided acr value is not supported by server", args("supported_acr_values", acrValuesSupported, "received_value", requestedACRs));
}
authorizationEndpointRequest.addProperty("acr_values", requestedACRs);
env.putObject("authorization_endpoint_request", authorizationEndpointRequest);
logSuccess(String.format("Added acr_values of '%s' to authorization endpoint request", requestedACRs), authorizationEndpointRequest);
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddRandomJwksUriToServerConfiguration method evaluate.
@Override
@PreEnvironment(required = "server", strings = "random_jwks_uri_suffix")
@PostEnvironment(required = "server")
public Environment evaluate(Environment env) {
JsonObject server = env.getObject("server");
String currentJwksUri = OIDFJSON.getString(server.get("jwks_uri"));
String randomSuffix = env.getString("random_jwks_uri_suffix");
String newJwksUri = currentJwksUri + randomSuffix;
server.addProperty("jwks_uri", newJwksUri);
env.putObject("server", server);
log("Added random jwks_uri to server configuration", args("jwks_uri", newJwksUri));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddResponseTypeCodeIdTokenToServerConfiguration method evaluate.
@Override
@PreEnvironment(required = "server")
@PostEnvironment(required = "server")
public Environment evaluate(Environment env) {
JsonArray data = new JsonArray();
data.add("code id_token");
JsonObject server = env.getObject("server");
server.add("response_types_supported", data);
logSuccess("Added code id_token as response type supported", args("response_types_supported", data));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddSHashToIdTokenClaims method evaluate.
@Override
@PreEnvironment(required = "id_token_claims", strings = "s_hash")
@PostEnvironment(required = "id_token_claims")
public Environment evaluate(Environment env) {
JsonObject claims = env.getObject("id_token_claims");
String hash = env.getString("s_hash");
claims.addProperty("s_hash", hash);
env.putObject("id_token_claims", claims);
logSuccess("Added s_hash to ID token claims", args("id_token_claims", claims, "s_hash", hash));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddTLSClientAuthToServerConfiguration method evaluate.
@Override
@PreEnvironment(required = "server")
@PostEnvironment(required = "server")
public Environment evaluate(Environment env) {
JsonArray data = new JsonArray();
data.add("tls_client_auth");
JsonObject server = env.getObject("server");
server.add("token_endpoint_auth_methods_supported", data);
logSuccess("Added tls_client_auth for token_endpoint_auth_methods_supported");
return env;
}
Aggregations