how to send redirect

Jason Novotny jason.novotny at gmail.com
Thu Nov 6 12:26:19 EST 2014


Hi,

I'm trying to implement SSO outbound, where a user clicks a link on my 
site and is authenticated to 3rdparty.com.
I have a test servlet that should do the redirect to thirdparty.com 
which will refer back to mywebsite.com/sso so that it can get a 
AuthnRequest and generate a SAMLResponse.

The servlet code is:

public class SSOServlet extends HttpServlet {

     public void doGet(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
response.sendRedirect("https://thirdparty.com/samlssorequest?authnReqRedirectUrl=https://mywebsite.com/sso");
     }

     public void doPost(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
         doGet(request, response);
     }

}

However, thirdparty.com only allows IP connections coming from the 
server that is hosting this servlet, so a client's browser cannot 
connect to thirdparty.com. When I try this out, it just appears to hang 
since thirdparty.com won't allow browser connections.

Any suggestions on what I can do are greatly appreciated.

Thanks, Jason



More information about the dev mailing list