Class HomeController

java.lang.Object
com.okta.spring.example.controllers.HomeController

@Controller public class HomeController extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.web.servlet.ModelAndView
    Display the custom sec qn registration page.
    org.springframework.web.servlet.ModelAndView
    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(String interactionCode, String state, String otp, String error, 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(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, String completedAuthenticatorType)
    Display the select authenticator page.
    org.springframework.web.servlet.ModelAndView
    displayUserActivationPage(String activationToken, javax.servlet.http.HttpSession session)
    Activate user with activation token.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HomeController

      public HomeController()
  • Method Details

    • displayIndexOrHomePage

      @RequestMapping(value={"/","**/callback"}, method=GET) public org.springframework.web.servlet.ModelAndView displayIndexOrHomePage(@RequestParam(name="interaction_code",required=false) String interactionCode, @RequestParam(name="state",required=false) String state, @RequestParam(name="otp",required=false) String otp, @RequestParam(name="error",required=false) String error, @RequestParam(name="error_description",required=false) 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") 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") 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) String completedAuthenticatorType)
      Display the select authenticator page.
      Parameters:
      session - the http session
      completedAuthenticatorType - 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
    • displayCustomSecQnPage

      @GetMapping("/register-custom-sec-qn") public org.springframework.web.servlet.ModelAndView displayCustomSecQnPage()
      Display the custom sec qn registration page.
      Returns:
      the custom sec qn registration page view
    • displayErrorPage

      @GetMapping("/error") public org.springframework.web.servlet.ModelAndView displayErrorPage()
      Display the error page.
      Returns:
      the error page view