use of io.jans.ca.common.params.RpGetRptParams in project jans by JanssenProject.
the class UmaFullTest method test.
@Parameters({ "host", "redirectUrls", "opHost", "rsProtect" })
@Test
public void test(String host, String redirectUrls, String opHost, String rsProtect) throws Exception {
ClientInterface client = Tester.newClient(host);
RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls);
RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources());
final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null);
final RpGetRptParams params = new RpGetRptParams();
params.setRpId(site.getRpId());
params.setTicket(checkAccess.getTicket());
final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(site), null, params);
assertNotNull(response);
assertTrue(StringUtils.isNotBlank(response.getRpt()));
assertTrue(StringUtils.isNotBlank(response.getPct()));
}
use of io.jans.ca.common.params.RpGetRptParams in project jans by JanssenProject.
the class UmaFullTest method testWithInvalidTicket.
@Parameters({ "host", "redirectUrls", "opHost", "rsProtect" })
@Test
public void testWithInvalidTicket(String host, String redirectUrls, String opHost, String rsProtect) throws Exception {
ClientInterface client = Tester.newClient(host);
RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls);
RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources());
final RpGetRptParams params = new RpGetRptParams();
params.setRpId(site.getRpId());
params.setTicket(UUID.randomUUID().toString());
try {
client.umaRpGetRpt(Tester.getAuthorization(site), null, params);
} catch (BadRequestException ex) {
return;
}
throw new AssertionError();
}
use of io.jans.ca.common.params.RpGetRptParams in project jans by JanssenProject.
the class RpGetRptTest method requestRpt.
public static RpGetRptResponse requestRpt(ClientInterface client, RegisterSiteResponse site, String rsProtect) throws IOException {
RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources());
final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null);
final RpGetRptParams params = new RpGetRptParams();
params.setRpId(site.getRpId());
params.setTicket(checkAccess.getTicket());
final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(site), null, params);
assertNotNull(response);
assertTrue(StringUtils.isNotBlank(response.getRpt()));
assertTrue(StringUtils.isNotBlank(response.getPct()));
return response;
}
use of io.jans.ca.common.params.RpGetRptParams in project jans by JanssenProject.
the class UmaFullTest method mockTest.
@Parameters({ "host", "redirectUrls", "opHost", "rsProtect" })
@Test
public void mockTest(String host, String redirectUrls, String opHost, String rsProtect) throws Exception {
ClientInterface client = Tester.newClient(host);
RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls);
RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources());
final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null);
final RpGetRptParams params = new RpGetRptParams();
params.setRpId(site.getRpId());
params.setTicket(checkAccess.getTicket());
final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(), null, params);
assertNotNull(response);
assertTrue(StringUtils.isNotBlank(response.getRpt()));
assertTrue(StringUtils.isNotBlank(response.getPct()));
}
use of io.jans.ca.common.params.RpGetRptParams in project jans by JanssenProject.
the class DifferentAuthServerTest method umaFullTest_withDifferentAuthServer.
@Parameters({ "host", "authServer", "redirectUrls", "opHost", "rsProtect" })
@Test
public void umaFullTest_withDifferentAuthServer(String host, String authServer, String redirectUrls, String opHost, String rsProtect) throws Exception {
ClientInterface client = Tester.newClient(host);
RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrls);
RegisterSiteResponse authServerResp = RegisterSiteTest.registerSite(client, authServer, redirectUrls);
RsProtectTest.protectResources(client, site, UmaFullTest.resourceList(rsProtect).getResources());
final RsCheckAccessResponse checkAccess = RsCheckAccessTest.checkAccess(client, site, null);
final RpGetRptParams params = new RpGetRptParams();
params.setRpId(site.getRpId());
params.setTicket(checkAccess.getTicket());
final RpGetRptResponse response = client.umaRpGetRpt(Tester.getAuthorization(authServerResp), authServerResp.getRpId(), params);
Assert.assertNotNull(response);
assertTrue(StringUtils.isNotBlank(response.getRpt()));
assertTrue(StringUtils.isNotBlank(response.getPct()));
}
Aggregations