Class HomeController
- java.lang.Object
-
- com.okta.spring.example.controllers.HomeController
-
@Controller public class HomeController extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HomeController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.web.servlet.ModelAndView
displayErrorPage()
Display the error page.org.springframework.web.servlet.ModelAndView
displayForgotPasswordPage(javax.servlet.http.HttpSession session)
Display the forgot password page.org.springframework.web.servlet.ModelAndView
displayIndexOrHomePage(java.lang.String interactionCode, java.lang.String state, java.lang.String otp, java.lang.String error, java.lang.String errDesc, javax.servlet.http.HttpSession session)
Display one of:org.springframework.web.servlet.ModelAndView
displayLoginPage(javax.servlet.http.HttpSession session)
Display the login page with username and password (optional).org.springframework.web.servlet.ModelAndView
displayRegisterPage(javax.servlet.http.HttpSession session)
Display the registration page.org.springframework.web.servlet.ModelAndView
displayResetPasswordPage(java.lang.String recoveryToken, javax.servlet.http.HttpSession session)
Handle the self-service password reset (SSPR) redirect.org.springframework.web.servlet.ModelAndView
displaySelectAuthenticatorPage(javax.servlet.http.HttpSession session, java.lang.String completedAuthenticatorType)
Display the select authenticator page.org.springframework.web.servlet.ModelAndView
displayUserActivationPage(java.lang.String activationToken, javax.servlet.http.HttpSession session)
Activate user with activation token.
-
-
-
Method Detail
-
displayIndexOrHomePage
@RequestMapping(value={"/","**/callback"}, method=GET) public org.springframework.web.servlet.ModelAndView displayIndexOrHomePage(@RequestParam(name="interaction_code",required=false) java.lang.String interactionCode, @RequestParam(name="state",required=false) java.lang.String state, @RequestParam(name="otp",required=false) java.lang.String otp, @RequestParam(name="error",required=false) java.lang.String error, @RequestParam(name="error_description",required=false) java.lang.String errDesc, javax.servlet.http.HttpSession session)
Display one of:a) index page - if the user is not authenticated yet (does not have token response in session). b) home page - if the user is authenticated (or) we have obtained a token for the user from the interaction code or otp in callback. c) info page - if the user is unauthenticated yet and has received an otp in callback. the info page will ask the user to input otp in the original browser to continue with the flow. d) error page - if the received state does not correlate with the state in client context or if the callback contains error parameters.
where index page refers to the root view with table of contents, and home page refers to the view that shows the user profile information along with token information.
- Parameters:
interactionCode
- the interaction code from callback (optional)state
- the state value from callback (optional)otp
- the one time password or verification code (optional)error
- the error from callback when interaction_code could not be sent (optional)errDesc
- the error_description from callback (optional)session
- the http session- Returns:
- the index page view with table of contents or the home page view if we have a token or the info page.
-
displayResetPasswordPage
@GetMapping("/reset-password") public org.springframework.web.servlet.ModelAndView displayResetPasswordPage(@RequestParam(name="recovery_token") java.lang.String recoveryToken, javax.servlet.http.HttpSession session)
Handle the self-service password reset (SSPR) redirect.- Parameters:
recoveryToken
- the recovery token (from email link)session
- the http session- Returns:
- the register-password view
-
displayUserActivationPage
@GetMapping("/activate") public org.springframework.web.servlet.ModelAndView displayUserActivationPage(@RequestParam(name="token") java.lang.String activationToken, javax.servlet.http.HttpSession session)
Activate user with activation token.- Parameters:
activationToken
- the activation token (from email link)session
- the http session- Returns:
- the authenticator selection or home page view
-
displayLoginPage
@GetMapping("/login") public org.springframework.web.servlet.ModelAndView displayLoginPage(javax.servlet.http.HttpSession session)
Display the login page with username and password (optional).- Parameters:
session
- the http session- Returns:
- the login view
-
displaySelectAuthenticatorPage
@GetMapping("/select-authenticator") public org.springframework.web.servlet.ModelAndView displaySelectAuthenticatorPage(javax.servlet.http.HttpSession session, @RequestParam(value="completed",required=false) java.lang.String completedAuthenticatorType)
Display the select authenticator page.- Parameters:
session
- the http sessioncompletedAuthenticatorType
- the last enrolled/verified authenticator type- Returns:
- the select authenticators view.
-
displayForgotPasswordPage
@GetMapping("/forgot-password") public org.springframework.web.servlet.ModelAndView displayForgotPasswordPage(javax.servlet.http.HttpSession session)
Display the forgot password page.- Parameters:
session
- the http session- Returns:
- the forgot password view
-
displayRegisterPage
@GetMapping("/register") public org.springframework.web.servlet.ModelAndView displayRegisterPage(javax.servlet.http.HttpSession session)
Display the registration page.- Parameters:
session
- the http session- Returns:
- the register view
-
displayErrorPage
@GetMapping("/error") public org.springframework.web.servlet.ModelAndView displayErrorPage()
Display the error page.- Returns:
- the error page view
-
-