82 log.trace(
"gatherClaims client_id: {}, ticket: {}, claims_redirect_uri: {}, state: {}, authenticationRedirect: {}, queryString: {}",
83 clientId, ticket, claimRedirectUri, state, authenticationRedirect, httpRequest.getQueryString());
87 if (authenticationRedirect != null && authenticationRedirect) {
88 log.debug(
"Authentication redirect, restoring parameters from session ...");
89 if (session == null) {
90 log.error(
"Session is null however authentication=true. Wrong workflow! Please correct custom Glaims-Gathering Script.");
97 log.debug(
"Restored parameters from session, clientId: {}, ticket: {}, claims_redirect_uri: {}, state: {}",
98 clientId, ticket, claimRedirectUri, state);
106 if (script == null) {
107 log.error(
"Failed to determine claims-gathering script for names: " + Arrays.toString(scriptNames));
108 throw new UmaWebException(claimRedirectUri,
errorResponseFactory, INVALID_CLAIMS_GATHERING_SCRIPT_NAME, state);
119 if (step < stepsCount) {
125 baseEndpoint = StringUtils.removeEnd(baseEndpoint,
"restv1");
126 baseEndpoint = StringUtils.removeEnd(baseEndpoint,
"/");
128 String fullUri = baseEndpoint + page;
129 fullUri = StringUtils.removeEnd(fullUri,
".xhtml") +
".htm";
130 log.trace(
"Redirecting to page: '{}', fullUri: {}", page, fullUri);
131 return Response.status(FOUND).location(
new URI(fullUri)).build();
133 log.error(
"Step '{}' is more or equal to stepCount: '{}'", stepsCount);
135 }
catch (Exception ex) {
136 log.error(
"Exception happened", ex);
137 if (ex instanceof WebApplicationException) {
138 throw (WebApplicationException) ex;
142 log.error(
"Failed to handle call to UMA Claims Gathering Endpoint.");
143 throw new UmaWebException(Response.Status.INTERNAL_SERVER_ERROR,
errorResponseFactory, UmaErrorResponseType.SERVER_ERROR);
String getClaimsRedirectUri(SessionId session)
Definition: UmaSessionService.java:182
List< UmaPermission > validateTicketWithRedirect(String ticket, String claimsRedirectUri, String state)
Definition: UmaValidationService.java:251
int getStep(SessionId session)
Definition: UmaSessionService.java:90
AppConfiguration appConfiguration
Definition: UmaGatheringWS.java:75
CustomScriptConfiguration determineScript(String[] scriptNames)
Definition: ExternalUmaClaimsGatheringService.java:52
String getState(SessionId session)
Definition: UmaSessionService.java:190
UserService userService
Definition: UmaGatheringWS.java:77
UmaPermissionService permissionService
Definition: UmaGatheringWS.java:71
String getTicket(SessionId session)
Definition: UmaSessionService.java:198
String [] validatesGatheringScriptNames(String scriptNamesAsString, String claimsRedirectUri, String state)
Definition: UmaValidationService.java:469
int getStepsCount(CustomScriptConfiguration script, UmaGatherContext context)
Definition: ExternalUmaClaimsGatheringService.java:147
Logger log
Definition: UmaGatheringWS.java:61
static String getScriptNames(List< UmaPermission > permissions)
Definition: UmaGatheringWS.java:146
String getBaseEndpoint()
Definition: AppConfiguration.java:328
String getClientId(SessionId session)
Definition: UmaSessionService.java:174
String getPageForStep(CustomScriptConfiguration script, int step, UmaGatherContext context)
Definition: ExternalUmaClaimsGatheringService.java:160
ErrorResponseFactory errorResponseFactory
Definition: UmaGatheringWS.java:63
UmaValidationService validationService
Definition: UmaGatheringWS.java:65
ExternalUmaClaimsGatheringService external
Definition: UmaGatheringWS.java:67
void configure(SessionId session, String scriptName, Boolean reset, List< UmaPermission > permissions, String clientId, String claimRedirectUri, String state)
Definition: UmaSessionService.java:104
Client validateClientAndClaimsRedirectUri(String clientId, String claimsRedirectUri, String state)
Definition: UmaValidationService.java:409
UmaSessionService sessionService
Definition: UmaGatheringWS.java:69
SessionId getSession(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
Definition: UmaSessionService.java:54
UmaPctService pctService
Definition: UmaGatheringWS.java:73