use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddClientIdToAuthorizationEndpointRequest method evaluate.
@Override
@PreEnvironment(required = { "authorization_endpoint_request", "client" })
@PostEnvironment(required = "authorization_endpoint_request")
public Environment evaluate(Environment env) {
JsonObject authorizationEndpointRequest = env.getObject("authorization_endpoint_request");
String clientId = env.getString("client", "client_id");
if (Strings.isNullOrEmpty(clientId)) {
throw error("client_id missing/empty in client object");
}
authorizationEndpointRequest.addProperty("client_id", clientId);
env.putObject("authorization_endpoint_request", authorizationEndpointRequest);
logSuccess("Added client_id of '" + clientId + "' to authorization endpoint request", authorizationEndpointRequest);
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddInitiateLoginUriAsNonHttpsToDynamicRegistrationRequest method evaluate.
@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "initiate_login_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
String initiateLoginUri = env.getString("initiate_login_uri");
JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
initiateLoginUri = initiateLoginUri.replace("https://", "http://");
dynamicRegistrationRequest.addProperty("initiate_login_uri", initiateLoginUri);
env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
log("Added non-https version of initiate_login_uri to dynamic registration request", args("initiate_login_uri", initiateLoginUri));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddInitiateLoginUriToDynamicRegistrationRequest method evaluate.
@Override
@PreEnvironment(required = "dynamic_registration_request", strings = "initiate_login_uri")
@PostEnvironment(required = "dynamic_registration_request")
public Environment evaluate(Environment env) {
String initiateLoginUri = env.getString("initiate_login_uri");
JsonObject dynamicRegistrationRequest = env.getObject("dynamic_registration_request");
dynamicRegistrationRequest.addProperty("initiate_login_uri", initiateLoginUri);
env.putObject("dynamic_registration_request", dynamicRegistrationRequest);
log("Added initiate_login_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 AddIpV6FapiCustomerIpAddressToResourceEndpointRequest method evaluate.
@Override
@PostEnvironment(required = "resource_endpoint_request_headers")
public Environment evaluate(Environment env) {
JsonObject headers = env.getObject("resource_endpoint_request_headers");
String ip = env.getString("resource", "x_fapi_customer_ipv4_address");
if (Strings.isNullOrEmpty(ip)) {
ip = "2001:DB8::1893:25c8:1946";
}
headers.addProperty("x-fapi-customer-ip-address", ip);
log("Added x-fapi-customer-ip-address containing IPv6 address to resource endpoint request headers", args("resource_endpoint_request_headers", headers));
return env;
}
use of net.openid.conformance.condition.PostEnvironment in project conformance-suite by openid-certification.
the class AddFAPIAuthDateToResourceEndpointRequest method evaluate.
@Override
@PostEnvironment(required = "resource_endpoint_request_headers")
public Environment evaluate(Environment env) {
// User just logged in
Date loginDate = new Date();
JsonObject headers = env.getObject("resource_endpoint_request_headers");
headers.addProperty("x-fapi-auth-date", DateUtils.formatDate(loginDate));
logSuccess("Added x-fapi-auth-date to resource endpoint request headers", args("resource_endpoint_request_headers", headers));
return env;
}
Aggregations