String newTicket = permissionService.changeTicket(permissions, ticketAttributes); UmaNeedInfoResponse needInfoResponse = new UmaNeedInfoResponse(); needInfoResponse.setTicket(newTicket); needInfoResponse.setError("need_info"); needInfoResponse.setRedirectUser(buildClaimsGatheringRedirectUri(scriptMap.values(), client, newTicket)); needInfoResponse.setRequiredClaims(missedClaims);
@Test(dependsOnMethods = {"requestRptAndGetNeedsInfo"}) @Parameters({"umaPatClientId"}) public void claimsGathering(String umaPatClientId) throws Exception { String gatheringUrl = needInfo.buildClaimsGatheringUrl(umaPatClientId, this.metadata.getClaimsInteractionEndpoint()); System.out.println(gatheringUrl); System.out.println(); try { startSelenium(); driver.navigate().to(gatheringUrl); System.out.println(driver.getCurrentUrl()); driver.findElement(By.id("loginForm:country")).sendKeys("US"); driver.findElement(By.id("loginForm:gather")).click(); Thread.sleep(1000); System.out.println(driver.getCurrentUrl()); driver.findElement(By.id("loginForm:city")).sendKeys("NY"); driver.findElement(By.id("loginForm:gather")).click(); Thread.sleep(1200); // Finally after claims-redirect flow user gets redirect with new ticket // Sample: https://client.example.com/cb?ticket=e8e7bc0b-75de-4939-a9b1-2425dab3d5ec System.out.println(driver.getCurrentUrl()); claimsGatheringTicket = StringUtils.substringAfter(driver.getCurrentUrl(), "ticket="); } finally { stopSelenium(); } }