use of org.gluu.oxauth.client.ResponseAsserter in project oxAuth by GluuFederation.
the class OpenIDRequestObjectWithESAlgEmbeddedTest method requestParameterMethodES256X509CertStep1.
@Parameters({ "registerPath", "redirectUris", "clientJwksUri" })
@Test
public void requestParameterMethodES256X509CertStep1(final String registerPath, final String redirectUris, final String jwksUri) throws Exception {
Builder request = ResteasyClientBuilder.newClient().target(url.toString() + registerPath).request();
String registerRequestContent = null;
try {
List<ResponseType> responseTypes = Arrays.asList(ResponseType.TOKEN);
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app", StringUtils.spaceSeparatedToList(redirectUris));
registerRequest.setJwksUri(jwksUri);
registerRequest.setResponseTypes(responseTypes);
registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.ES256);
registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
registerRequestContent = ServerUtil.toPrettyJson(registerRequest.getJSONParameters());
} catch (JSONException e) {
fail(e.getMessage(), e);
}
Response response = request.post(Entity.json(registerRequestContent));
String entity = response.readEntity(String.class);
showResponse("requestParameterMethodES256X509CertStep1", response, entity);
ResponseAsserter responseAsserter = ResponseAsserter.of(response.getStatus(), entity);
responseAsserter.assertRegisterResponse();
clientId4 = responseAsserter.getJson().getJson().getString(RegisterResponseParam.CLIENT_ID.toString());
}
use of org.gluu.oxauth.client.ResponseAsserter in project oxAuth by GluuFederation.
the class OpenIDRequestObjectWithESAlgEmbeddedTest method requestParameterMethodES512X509CertStep1.
@Parameters({ "registerPath", "redirectUris", "clientJwksUri" })
@Test
public void requestParameterMethodES512X509CertStep1(final String registerPath, final String redirectUris, final String jwkUri) throws Exception {
Builder request = ResteasyClientBuilder.newClient().target(url.toString() + registerPath).request();
String registerRequestContent = null;
try {
List<ResponseType> responseTypes = Arrays.asList(ResponseType.TOKEN);
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app", StringUtils.spaceSeparatedToList(redirectUris));
registerRequest.setJwksUri(jwkUri);
registerRequest.setResponseTypes(responseTypes);
registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.ES512);
registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
registerRequestContent = ServerUtil.toPrettyJson(registerRequest.getJSONParameters());
} catch (JSONException e) {
fail(e.getMessage(), e);
}
Response response = request.post(Entity.json(registerRequestContent));
String entity = response.readEntity(String.class);
showResponse("requestParameterMethodES512X509CertStep1", response, entity);
ResponseAsserter responseAsserter = ResponseAsserter.of(response.getStatus(), entity);
responseAsserter.assertRegisterResponse();
clientId6 = responseAsserter.getJson().getJson().getString(RegisterResponseParam.CLIENT_ID.toString());
}
use of org.gluu.oxauth.client.ResponseAsserter in project oxAuth by GluuFederation.
the class OpenIDRequestObjectWithESAlgEmbeddedTest method requestParameterMethodES512Step1.
@Parameters({ "registerPath", "redirectUris", "clientJwksUri" })
@Test
public void requestParameterMethodES512Step1(final String registerPath, final String redirectUris, final String jwksUri) throws Exception {
Builder request = ResteasyClientBuilder.newClient().target(url.toString() + registerPath).request();
String registerRequestContent = null;
try {
List<ResponseType> responseTypes = Arrays.asList(ResponseType.TOKEN);
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app", StringUtils.spaceSeparatedToList(redirectUris));
registerRequest.setJwksUri(jwksUri);
registerRequest.setResponseTypes(responseTypes);
registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.ES512);
registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
registerRequestContent = ServerUtil.toPrettyJson(registerRequest.getJSONParameters());
} catch (JSONException e) {
fail(e.getMessage(), e);
}
Response response = request.post(Entity.json(registerRequestContent));
String entity = response.readEntity(String.class);
showResponse("requestParameterMethodES512Step1", response, entity);
ResponseAsserter responseAsserter = ResponseAsserter.of(response.getStatus(), entity);
responseAsserter.assertRegisterResponse();
clientId3 = responseAsserter.getJson().getJson().getString(RegisterResponseParam.CLIENT_ID.toString());
}
use of org.gluu.oxauth.client.ResponseAsserter in project oxAuth by GluuFederation.
the class OpenIDRequestObjectWithRSAlgEmbeddedTest method requestParameterMethodRS384Step1.
@Parameters({ "registerPath", "redirectUris", "clientJwksUri" })
@Test
public void requestParameterMethodRS384Step1(final String registerPath, final String redirectUris, final String jwksUri) throws Exception {
Builder request = ResteasyClientBuilder.newClient().target(url.toString() + registerPath).request();
String registerRequestContent = null;
try {
List<ResponseType> responseTypes = Arrays.asList(ResponseType.TOKEN);
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app", StringUtils.spaceSeparatedToList(redirectUris));
registerRequest.setJwksUri(jwksUri);
registerRequest.setResponseTypes(responseTypes);
registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.RS384);
registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
registerRequestContent = ServerUtil.toPrettyJson(registerRequest.getJSONParameters());
} catch (JSONException e) {
e.printStackTrace();
fail(e.getMessage());
}
Response response = request.post(Entity.json(registerRequestContent));
String entity = response.readEntity(String.class);
showResponse("requestParameterMethodRS384Step1", response, entity);
ResponseAsserter responseAsserter = ResponseAsserter.of(response.getStatus(), entity);
responseAsserter.assertRegisterResponse();
clientId2 = responseAsserter.getJson().getJson().getString(RegisterResponseParam.CLIENT_ID.toString());
}
use of org.gluu.oxauth.client.ResponseAsserter in project oxAuth by GluuFederation.
the class OpenIDRequestObjectWithRSAlgEmbeddedTest method requestParameterMethodRS512Step1.
@Parameters({ "registerPath", "redirectUris", "clientJwksUri" })
@Test
public void requestParameterMethodRS512Step1(final String registerPath, final String redirectUris, final String jwksUri) throws Exception {
Builder request = ResteasyClientBuilder.newClient().target(url.toString() + registerPath).request();
String registerRequestContent = null;
try {
List<ResponseType> responseTypes = Arrays.asList(ResponseType.TOKEN);
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app", StringUtils.spaceSeparatedToList(redirectUris));
registerRequest.setJwksUri(jwksUri);
registerRequest.setResponseTypes(responseTypes);
registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.RS512);
registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
registerRequestContent = ServerUtil.toPrettyJson(registerRequest.getJSONParameters());
} catch (JSONException e) {
e.printStackTrace();
fail(e.getMessage());
}
Response response = request.post(Entity.json(registerRequestContent));
String entity = response.readEntity(String.class);
showResponse("requestParameterMethodRS512Step1", response, entity);
ResponseAsserter responseAsserter = ResponseAsserter.of(response.getStatus(), entity);
responseAsserter.assertRegisterResponse();
clientId3 = responseAsserter.getJson().getJson().getString(RegisterResponseParam.CLIENT_ID.toString());
}
Aggregations