use of com.okta.spring.example.helpers.PollResults in project okta-idx-java by okta.
the class LoginController method pollResults.
/**
* Handle poll functionality.
*
* @param session the session
* @return the view associated with authentication response.
*/
@GetMapping("/poll")
@ResponseBody
public PollResults pollResults(final HttpSession session) {
PollResults pollResults = new PollResults();
ProceedContext proceedContext = Util.getProceedContextForPoll(session);
if (proceedContext == null) {
proceedContext = Util.getProceedContextFromSession(session);
}
AuthenticationResponse authenticationResponse = idxAuthenticationWrapper.poll(proceedContext);
if (responseHandler.needsToShowErrors(authenticationResponse)) {
pollResults.setErrors(authenticationResponse.getErrors());
}
pollResults.setStatus(authenticationResponse.getAuthenticationStatus());
if (authenticationResponse.getAuthenticationStatus() == AuthenticationStatus.SUCCESS) {
responseHandler.handleTerminalTransitions(authenticationResponse, session);
}
return pollResults;
}
Aggregations