use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.
the class GetAuthorizationUrlTest method testWithNonceParameter.
@Parameters({ "host", "opHost", "redirectUrls", "postLogoutRedirectUrl", "logoutUrl", "paramRedirectUrl" })
@Test
public void testWithNonceParameter(String host, String opHost, String redirectUrls, String postLogoutRedirectUrl, String logoutUrl, String paramRedirectUrl) throws IOException {
ClientInterface client = Tester.newClient(host);
final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls, postLogoutRedirectUrl, logoutUrl, false);
final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams();
commandParams.setRpId(site.getRpId());
commandParams.setRedirectUri(paramRedirectUrl);
commandParams.setNonce("dummy_nonce");
final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(site), null, commandParams);
assertNotNull(resp);
notEmpty(resp.getAuthorizationUrl());
assertTrue(resp.getAuthorizationUrl().contains(paramRedirectUrl));
Map<String, String> parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl());
assertTrue(StringUtils.isNotBlank(parameters.get("nonce")));
assertEquals(parameters.get("nonce"), "dummy_nonce");
}
use of io.jans.ca.client.ClientInterface in project jans by JanssenProject.
the class GetDiscoveryTest method test_withOpConfigurationEndpoint.
@Parameters({ "host", "opConfigurationEndpoint" })
@Test
public void test_withOpConfigurationEndpoint(String host, String opConfigurationEndpoint) {
ClientInterface client = Tester.newClient(host);
final GetDiscoveryParams commandParams = new GetDiscoveryParams();
commandParams.setOpConfigurationEndpoint(opConfigurationEndpoint);
final GetDiscoveryResponse resp = client.getDiscovery(commandParams);
assertNotNull(resp);
assertNotNull(resp.getIssuer());
}
Aggregations