Custom Authentication

Joel Goguen's Avatar

Joel Goguen

22 Sep, 2010 06:52 PM

I'm trying to write a Java class to deal with custom authentication for Cascade 6.7.2, but I'm not sure how the redirect() method works. I understand that I need to return true if I want a redirection to occur, but I'm not clear on how to specify where to redirect to or how to set the status code. Do I simply call the setStatus() method to choose the status code and call setHeader() to set the HTTP Location header?

  1. 1 Posted by Mike on 22 Sep, 2010 08:44 PM

    Mike's Avatar

    Hi Joel,

    You'll want to use the sendRedirect(String url) method on the response object, that is passed as a parameter to redirect(), to do the actual redirect.

    So your code would look something like this:

    public boolean redirect(HttpServletRequest request, HttpServletResponse response, AuthenticationPhase phase) throws IOException
    {
        if (phase == AuthenticationPhase.LOGIN)
        {
            response.sendRedirect("http://mycustomauthapp.com/login");
            return true;
        }
    }
  2. Tim closed this discussion on 06 Oct, 2010 02:30 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac