Search in sources :

Example 56 with PostEnvironment

use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.

the class AddFAPIInteractionIdToResourceEndpointRequest method evaluate.

@Override
@PreEnvironment(strings = "fapi_interaction_id", required = "resource_endpoint_request_headers")
@PostEnvironment(required = "resource_endpoint_request_headers")
public Environment evaluate(Environment env) {
    JsonObject headers = env.getObject("resource_endpoint_request_headers");
    String interactionId = env.getString("fapi_interaction_id");
    headers.addProperty("x-fapi-interaction-id", interactionId);
    logSuccess("Added x-fapi-interaction-id to resource endpoint request headers", args("resource_endpoint_request_headers", headers));
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 57 with PostEnvironment

use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.

the class AddDpopHeaderForTokenEndpointRequest method evaluate.

@Override
@PreEnvironment(strings = "dpop_proof")
@PostEnvironment(required = "token_endpoint_request_headers")
public Environment evaluate(Environment env) {
    String dpopProof = env.getString("dpop_proof");
    JsonObject headers = env.getObject("token_endpoint_request_headers");
    if (headers == null) {
        headers = new JsonObject();
        env.putObject("token_endpoint_request_headers", headers);
    }
    headers.addProperty("DPoP", dpopProof);
    logSuccess("Set DPoP header", args("DPoP", dpopProof));
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 58 with PostEnvironment

use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.

the class AddAuthReqIdToTokenEndpointRequest method evaluate.

@Override
@PreEnvironment(required = { "token_endpoint_request_form_parameters", "backchannel_authentication_endpoint_response" })
@PostEnvironment(required = "token_endpoint_request_form_parameters")
public Environment evaluate(Environment env) {
    JsonObject o = env.getObject("token_endpoint_request_form_parameters");
    final String authReqId = env.getString("backchannel_authentication_endpoint_response", "auth_req_id");
    if (authReqId == null) {
        throw error("auth_req_id missing from backchannel_authentication_endpoint_response");
    }
    o.addProperty("auth_req_id", authReqId);
    env.putObject("token_endpoint_request_form_parameters", o);
    log(o);
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 59 with PostEnvironment

use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.

the class AddFrontchannelLogoutUriToDynamicRegistrationRequest method evaluate.

@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "frontchannel_logout_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
    String frontchannelLogoutUri = env.getString("frontchannel_logout_uri");
    JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
    dynamicRegistrationRequest.addProperty("frontchannel_logout_uri", frontchannelLogoutUri);
    env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
    log("Added frontchannel_logout_uri to dynamic registration request", args("dynamic_registration_request", dynamicRegistrationRequest));
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 60 with PostEnvironment

use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.

the class AddIdTokenSigningAlgNoneToDynamicRegistrationRequest method evaluate.

@Override
@PreEnvironment(required = "dynamic_registration_request")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
    JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
    dynamicRegistrationRequest.addProperty("id_token_signed_response_alg", "none");
    env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
    log("Added id_token_signed_response_alg to dynamic registration request", args("dynamic_registration_request", dynamicRegistrationRequest));
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Aggregations

PostEnvironment (net.openid.conformance.condition.PostEnvironment)399 PreEnvironment (net.openid.conformance.condition.PreEnvironment)379 JsonObject (com.google.gson.JsonObject)372 JsonElement (com.google.gson.JsonElement)61 JsonArray (com.google.gson.JsonArray)49 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)22 Instant (java.time.Instant)21 ParseException (java.text.ParseException)17 CertificateException (java.security.cert.CertificateException)16 IOException (java.io.IOException)15 KeyManagementException (java.security.KeyManagementException)15 KeyStoreException (java.security.KeyStoreException)15 UnrecoverableKeyException (java.security.UnrecoverableKeyException)15 InvalidKeySpecException (java.security.spec.InvalidKeySpecException)15 RestClientException (org.springframework.web.client.RestClientException)15 RestTemplate (org.springframework.web.client.RestTemplate)15 JOSEException (com.nimbusds.jose.JOSEException)9 JWK (com.nimbusds.jose.jwk.JWK)9 RestClientResponseException (org.springframework.web.client.RestClientResponseException)9 JWKSet (com.nimbusds.jose.jwk.JWKSet)7