authentication - App Engine Login Redirect Fails -


On March 1, 2011 App Engine has changed its entry flow, my app (see broke Google Groups). This issue also came in this stack overflow. Suggested perform answer

"App redirected. That createLoginUrl only a URL to the URL the application to work when released. After another app / host is to be sent to the user needs to login and then to your app redirects "

and

" a redirect handler on your application. that target parameters continue Is and Setting it up is the final redirection on your actual goal of sending it ".

I am asking the question how to do this work. My application exposes two GAE apps, one GWT front end, and the rest to a REST API. Here is the current flow GAE UserServiceFactory.getUserService ().

Browse for the user and GWT makes a JSONP call to do a servlet.

/ User checks the servlet. GetCurrentUser () to see if it's empty. For those not logged in, it is empty, and the servlet returns JSONP that the user is not logged in.

GWT code message is "not logged in", and does

  string login = "http://my-back.appspot.com/Login" ; window. Open (login, "_self", "");   

Login servlet:

  public void doActualGet (HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException {UserService userService = UserServiceFactory.getUserService (); String url = "http://my-back.appspot.com/LoginRedirectServlet"; // string url = "http://my-front.appspot.com"; & Lt; --------- 1 Mar before log.info ("again redirect again:" + url); String redirect = userService.createLoginURL (url); Resp.setStatus (301); Resp.setHeader ("Location", Redirect); Resp.setHeader ("connection", "off"); }   

There is a line in my new LoginRedirectServlet:

  resp.sendRedirect ( "http://my-front.appspot.com/");   

This usually results in a redirect loop, though sometimes it works after killing the initial URL. My suspicion is that there is something wrong with the code near the window. Open, but I'm open to all suggestions. The

Thanks, Glenn

Post text "itemprop =" text ">

try to use the window. Location. Signature (url) Instead of Window.open (..) .

Update:

Potential Issue: You Cache Browser 301 Redirects (Chrome does this for example). Since your login creates the servlet redirect and if it is cached it will produce a loop. Use other redirect code. Try to shoot: 302 or 307.

Comments