Search in sources :

Example 96 with PostEnvironment

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

the class AddPAREndpointAsAudToRequestObject method evaluate.

@Override
@PreEnvironment(required = { "request_object_claims" })
@PostEnvironment(required = { "request_object_claims" })
public Environment evaluate(Environment env) {
    JsonObject authzEndpointRequest = env.getObject("request_object_claims");
    String parEndpoint = env.getString("server", "pushed_authorization_request_endpoint");
    if (parEndpoint == null) {
        throw error("Could not find pushed_authorization_request_endpoint in the server metadata.");
    }
    authzEndpointRequest.addProperty("aud", parEndpoint);
    env.putObject("request_object_claims", authzEndpointRequest);
    logSuccess("Added aud to request object claims", args("aud", parEndpoint));
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 97 with PostEnvironment

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

the class AddPlainErrorResponseAsAuthorizationEndpointResponseForJARM method evaluate.

@Override
@PreEnvironment(required = "callback_query_params")
@PostEnvironment(required = "authorization_endpoint_response")
public Environment evaluate(Environment env) {
    JsonObject callbackQueryParams = env.getObject("callback_query_params");
    env.mapKey("authorization_endpoint_response", "callback_query_params");
    logSuccess("The server returned a plain error response instead of a JARM response", callbackQueryParams);
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 98 with PostEnvironment

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

the class AddPolicyUriToDynamicRegistrationRequest method evaluate.

@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "policy_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
    JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
    String policyUri = env.getString("policy_uri");
    dynamicRegistrationRequest.addProperty("policy_uri", policyUri);
    env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
    log("Added policy_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 99 with PostEnvironment

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

the class AddPostLogoutRedirectUriWithQueryAddedToEndSessionEndpointRequest method evaluate.

@Override
@PreEnvironment(required = "end_session_endpoint_request")
@PostEnvironment(required = "end_session_endpoint_request")
public Environment evaluate(Environment env) {
    JsonObject endSessionEndpointRequest = env.getObject("end_session_endpoint_request");
    String postLogoutUri = OIDFJSON.getString(endSessionEndpointRequest.get("post_logout_redirect_uri"));
    postLogoutUri += "?foo=bar";
    endSessionEndpointRequest.addProperty("post_logout_redirect_uri", postLogoutUri);
    env.putObject("end_session_endpoint_request", endSessionEndpointRequest);
    logSuccess("Added ?foo=bar to post_logout_redirect_uri in end session endpoint request", endSessionEndpointRequest);
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 100 with PostEnvironment

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

the class AddSoftwareStatementToClientConfigurationRequest method evaluate.

@Override
@PreEnvironment(required = { "registration_client_endpoint_request_body", "software_statement_assertion" })
@PostEnvironment(required = "registration_client_endpoint_request_body")
public Environment evaluate(Environment env) {
    JsonObject request = env.getObject("registration_client_endpoint_request_body");
    String assertion = env.getString("software_statement_assertion", "value");
    request.addProperty("software_statement", assertion);
    log("Added software_statement to client configuration request", args("client_configuration_request", request));
    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