简体   繁体   中英

How to preserve a Query String after Login(using Google's `userService`) on app engine using Java?

I am developing an application in java on GAE(Google App Engine). I have a JSP where I have used Google's userService to handle authentication through the gmail account,this works fine and users are able to Login using Gmail account.

I have used userService.createLoginURL(request.getRequestURI()) to create the Login url.

My requirement is that I append some Query Parameter at the end of base url of my application, and I send that url to the user, this is intended to take the user to a specific page with information pulled in from database based on the Query parameter after login.

However, when a user is not logged in and opens the url(having Query String) then it takes him to the Login Page, and after the Login, it is supposed to go to that specific page but after Login the query String is lost and it simply takes the user to the welcome page, which is not intended for this case.

How can I avoid this ? Is there a work around for this or this is just a limitation on App Engine ?

如果我们对网址应用安全约束,则查询字符串可以保留,这也需要访问页面或网址所需的登录名。

<security-constraint> <web-resource-collection> <web-resource-name>Any Name</web-resource-name> <url-pattern>/page or url you want to apply the security</url-pattern> </web-resource-collection> <auth-constraint> <role-name>*</role-name> </auth-constraint> </security-constraint>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM