use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddLogoUriToDynamicRegistrationRequest method evaluate.
@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "logo_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
String logoUri = env.getString("logo_uri");
dynamicRegistrationRequest.addProperty("logo_uri", logoUri);
env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
log("Added logo_uri 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 AddMultipleHintsToAuthorizationEndpointRequest 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");
// add two hints value to authorization endpoint request
String hintType1 = "login_hint";
String hintValue1 = "join@example.com";
authorizationEndpointRequest.addProperty(hintType1, hintValue1);
String hintType2 = "login_hint_token";
String hintValue2 = "xxxxxxxxxxxxxxxxxxxx";
authorizationEndpointRequest.addProperty(hintType2, hintValue2);
env.putObject("authorization_endpoint_request", authorizationEndpointRequest);
logSuccess("Added two hints value to authorization endpoint request", args(hintType1, hintValue1, hintType2, hintValue2));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddMultipleRedirectUriToDynamicRegistrationRequest method evaluate.
@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "redirect_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
if (!env.containsObject("dynamic_registration_request")) {
throw error("No dynamic registration request found");
}
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);
redirectUris.add("https://example.org/redirect");
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 AddCdrXCdsClientHeadersToResourceEndpointRequest method evaluate.
@Override
@PreEnvironment(required = "resource_endpoint_request_headers")
@PostEnvironment(required = "resource_endpoint_request_headers")
public Environment evaluate(Environment env) {
JsonObject headers = env.getObject("resource_endpoint_request_headers");
// example value taken from https://consumerdatastandardsaustralia.github.io/standards/#http-headers
// the contents of this header is very poorly defined, the format and contents is entirely at the discretion
// of the OAuth2 client.
headers.addProperty("x-cds-client-headers", "TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvNzkuMC4zOTQ1Ljg4IFNhZmFyaS81MzcuMzY=");
log("Added x-cds-client-headers to resource_endpoint_request_headers", headers);
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddCibaRequestSigningPS256ToDynamicRegistrationRequest 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_authentication_request_signing_alg", "PS256");
env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
log("Added CIBA request sign alg to dynamic registration request", args("dynamic_registration_request", dynamicRegistrationRequest));
return env;
}
Aggregations