I am using UserService to redirect to login page:
String loginURL = userService.createLoginURL(request.getRequestURI());
throw new ModelAndViewDefiningException(new ModelAndView(new RedirectView(loginURL, false)));
This is resulting in URL like:
(example = my domain name)
when someone is redirected, Google displays page with error:
The page you requested is invalid.
Any ideas what I am doing wrong?
This is so annoying, I tried to find solution for this – without any luck.
This is happening with GAE JDK 1.4.3 (Java)
Exactly same code was working in version 1.3.2, after a while I decided to play again with GAE, upgraded libraries … and now I have issue with logging in.
I encountered this problem today with GAE 1.6.3.
The login does not work with the URL you have given above:
https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%253Fcontinue%253Dhttp://www.example.com/logingoogle.htm<mpl=gm&ahname=example&sig=5291e6bad7249c73c4968655133c87c5
But it works if you replace “https://www.google.com/accounts/ServiceLogin?” with “https://accounts.google.com/ServiceLogin?” like this:
https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%253Fcontinue%253Dhttp://www.example.com/logingoogle.htm<mpl=gm&ahname=example&sig=5291e6bad7249c73c4968655133c87c5
Unfortunately it is not possible to modify the URL, since it is generated by UserService.
But i could get my app to generate the second URL in this way:
The default page of my app has initially directed requests through a “jsp:forward” to the controller that checked if the user was logged in. I have changed my app so that the requests are processed at first place by the controller (without a previous forward). That solved my problem. But i can’t explain what lies behind this misbehaviour.