use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddRedirectUriToClientConfigurationRequest method evaluate.
@Override
@PreEnvironment(required = "registration_client_endpoint_request_body", strings = "redirect_uri")
@PostEnvironment(required = "registration_client_endpoint_request_body")
public Environment evaluate(Environment env) {
JsonObject clientConfigRequest = env.getObject("registration_client_endpoint_request_body");
String redirectUri = env.getString("redirect_uri");
if (Strings.isNullOrEmpty(redirectUri)) {
throw error("No redirect_uri found");
}
JsonArray redirectUris = new JsonArray();
redirectUris.add(redirectUri);
clientConfigRequest.add("redirect_uris", redirectUris);
log("Added redirect_uris array to client configuration endpoint request", args("registration_client_endpoint_request", clientConfigRequest));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddRedirectUriToDynamicRegistrationRequest method evaluate.
@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "redirect_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
String redirectUri = env.getString("redirect_uri");
if (Strings.isNullOrEmpty(redirectUri)) {
throw error("No redirect_uri found");
}
JsonArray redirectUris = new JsonArray();
redirectUris.add(redirectUri);
dynamicRegistrationRequest.add("redirect_uris", redirectUris);
env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
log("Added redirect_uris array to dynamic registration request", args("dynamic_registration_request", dynamicRegistrationRequest));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddNbfToRequestObject method evaluate.
@Override
@PreEnvironment(required = { "request_object_claims" })
@PostEnvironment(required = { "request_object_claims" })
public Environment evaluate(Environment env) {
JsonObject requestObjectClaims = env.getObject("request_object_claims");
Instant nbf = Instant.now();
requestObjectClaims.addProperty("nbf", nbf.getEpochSecond());
env.putObject("request_object_claims", requestObjectClaims);
logSuccess("Added nbf to request object claims", args("nbf", requestObjectClaims.getAsJsonPrimitive("nbf")));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddNbfValueIs10MinutesInFutureToRequestObject method evaluate.
@Override
@PreEnvironment(required = "request_object_claims")
@PostEnvironment(required = "request_object_claims")
public Environment evaluate(Environment env) {
JsonObject requestObjectClaims = env.getObject("request_object_claims");
Instant nbf = Instant.now().plusSeconds(10 * 60);
requestObjectClaims.addProperty("nbf", nbf.getEpochSecond());
env.putObject("request_object_claims", requestObjectClaims);
logSuccess("Added invalid nbf value to request object which is 10 minutes in the future", args("request_object_claims", requestObjectClaims, "nbf_is_10_minutes_in_the_future", nbf));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddNonceToAuthorizationEndpointRequest method evaluate.
@Override
@PreEnvironment(strings = "nonce", required = "authorization_endpoint_request")
@PostEnvironment(required = "authorization_endpoint_request")
public Environment evaluate(Environment env) {
String nonce = env.getString("nonce");
if (Strings.isNullOrEmpty(nonce)) {
throw error("Couldn't find nonce value");
}
JsonObject authorizationEndpointRequest = env.getObject("authorization_endpoint_request");
authorizationEndpointRequest.addProperty("nonce", nonce);
env.putObject("authorization_endpoint_request", authorizationEndpointRequest);
logSuccess("Added nonce parameter to request", authorizationEndpointRequest);
return env;
}
Aggregations