109 final HttpServletRequest httpRequest = (HttpServletRequest)
externalContext.getRequest();
110 final HttpServletResponse httpResponse = (HttpServletResponse)
externalContext.getResponse();
113 if (session == null) {
114 log.error(
"Failed to restore claim-gathering session state");
115 errorPage(
"consent.gather.invalid.session");
119 CustomScriptConfiguration script =
getScript(session);
120 if (script == null) {
128 log.error(
"There are consent-gathering steps not marked as passed. scriptName: '{}', step: '{}'", script.getName(), step);
129 errorPage(
"consent.gather.invalid.step");
133 this.
context =
new ConsentGatheringContext(script.getConfigurationAttributes(), httpRequest, httpResponse, session,
136 log.debug(
"Consent-gathering result for script '{}', step: '{}', gatheredResult: '{}'", script.getName(), step, authorizeResult);
139 if (!authorizeResult && overridenNextStep == -1) {
140 SessionId connectSession = sessionService.getConnectSession(httpRequest);
145 if (overridenNextStep != -1) {
146 sessionService.resetToStep(session, overridenNextStep, step);
147 step = overridenNextStep;
151 if (step < stepsCount || overridenNextStep != -1) {
153 if (overridenNextStep != -1) {
154 nextStep = overridenNextStep;
157 sessionService.markStep(session, step,
true);
160 sessionService.setStep(nextStep, session);
165 log.trace(
"Redirecting to page: '{}'", redirectTo);
166 facesService.redirectWithExternal(redirectTo, null);
171 if (step == stepsCount) {
176 }
catch (Exception e) {
177 log.error(
"Exception during gather() method call.", e);
180 log.error(
"Failed to perform gather() method successfully.");
ConsentGatheringContext context
Definition: ConsentGathererService.java:72
void permissionDenied(final SessionId session)
Definition: AuthorizeService.java:185
boolean authorize(CustomScriptConfiguration script, int step, ConsentGatheringContext context)
Definition: ExternalConsentGatheringService.java:76
final Map< String, String > pageAttributes
Definition: ConsentGathererService.java:71
FacesService facesService
Definition: ConsentGathererService.java:57
void persist()
Definition: ConsentGatheringContext.java:110
AppConfiguration appConfiguration
Definition: ConsentGathererService.java:48
Logger log
Definition: ConsentGathererService.java:42
boolean isPassedPreviousSteps(SessionId session, Integer step)
Definition: ConsentGatheringSessionService.java:133
UserService userService
Definition: ConsentGathererService.java:66
ExternalContext externalContext
Definition: ConsentGathererService.java:54
ExternalConsentGatheringService external
Definition: ConsentGathererService.java:45
int getStep(SessionId session)
Definition: ConsentGatheringSessionService.java:107
void errorPage(String errorKey)
Definition: ConsentGathererService.java:236
String getPageForStep(CustomScriptConfiguration script, int step, ConsentGatheringContext context)
Definition: ExternalConsentGatheringService.java:128
void onSuccess(HttpServletRequest httpRequest, SessionId session, ConsentGatheringContext context)
Definition: ConsentGathererService.java:185
CustomScriptConfiguration getScript(final SessionId session)
Definition: ConsentGathererService.java:262
int getStepsCount(CustomScriptConfiguration script, ConsentGatheringContext context)
Definition: ExternalConsentGatheringService.java:115
AuthorizeService authorizeService
Definition: ConsentGathererService.java:69
String getScriptName(SessionId session)
Definition: ConsentGatheringSessionService.java:151
int getNextStep(CustomScriptConfiguration script, int step, ConsentGatheringContext context)
Definition: ExternalConsentGatheringService.java:89
ConsentGatheringSessionService sessionService
Definition: ConsentGathererService.java:63
SessionId getSession(HttpServletRequest httpRequest, HttpServletResponse httpResponse, String userDn, boolean create)
Definition: ConsentGatheringSessionService.java:54