Search in sources :

Example 46 with PostEnvironment

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

the class AddCibaTokenDeliveryModePollToDynamicRegistrationRequest 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("backchannel_token_delivery_mode", "poll");
    env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
    log("Added CIBA token delivery mode poll 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 47 with PostEnvironment

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

the class AddClaimsLocalesSeToAuthorizationEndpointRequest 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");
    authorizationEndpointRequest.addProperty("claims_locales", "se");
    env.putObject("authorization_endpoint_request", authorizationEndpointRequest);
    logSuccess("Added claims_locales=se to authorization endpoint request", authorizationEndpointRequest);
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 48 with PostEnvironment

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

the class AddClientAssertionToBackchannelAuthenticationEndpoint method evaluate.

@Override
@PreEnvironment(required = "backchannel_authentication_endpoint_request_form_parameters", strings = "client_assertion")
@PostEnvironment(required = "backchannel_authentication_endpoint_request_form_parameters")
public Environment evaluate(Environment env) {
    JsonObject o = env.getObject("backchannel_authentication_endpoint_request_form_parameters");
    o.addProperty("client_assertion", env.getString("client_assertion"));
    o.addProperty("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
    env.putObject("backchannel_authentication_endpoint_request_form_parameters", o);
    log("Added client assertion", o);
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 49 with PostEnvironment

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

the class AddClientAssertionToPAREndpointParameters method evaluate.

@Override
@PreEnvironment(strings = { CLIENT_ASSERTION }, required = "pushed_authorization_request_form_parameters")
@PostEnvironment(required = "pushed_authorization_request_form_parameters")
public Environment evaluate(Environment env) {
    JsonObject o = env.getObject("pushed_authorization_request_form_parameters");
    o.addProperty(CLIENT_ASSERTION, env.getString("client_assertion"));
    o.addProperty("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
    logSuccess("Added client assertion to request", args("request", o));
    return env;
}
Also used : JsonObject(com.google.gson.JsonObject) PostEnvironment(net.openid.conformance.condition.PostEnvironment) PreEnvironment(net.openid.conformance.condition.PreEnvironment)

Example 50 with PostEnvironment

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

the class AddClientAssertionToTokenEndpointRequest method evaluate.

@Override
@PreEnvironment(required = "token_endpoint_request_form_parameters", strings = "client_assertion")
@PostEnvironment(required = "token_endpoint_request_form_parameters")
public Environment evaluate(Environment env) {
    if (!env.containsObject("token_endpoint_request_form_parameters")) {
        throw error("Couldn't find request form");
    }
    JsonObject o = env.getObject("token_endpoint_request_form_parameters");
    o.addProperty("client_assertion", env.getString("client_assertion"));
    o.addProperty("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
    env.putObject("token_endpoint_request_form_parameters", o);
    log("Added client assertion", o);
    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