requestfactory security problem

85 views
Skip to first unread message

July

unread,
Aug 17, 2011, 3:01:19 AM8/17/11
to google-we...@googlegroups.com
hello all:
  I'm using GWT 2.3 requestfactory+ GAE 1.5 user authentication for my app, it only allows authenticated people to access, implemented as below:
if the user has not login to Google, redirect him the Google login screen.
if yes, check if he has the right to access. if yes display the web UI to user. or display error screen.

My question is:
1. Do i have to check every gwtrequest to ensure the security? i mean, use a filter to check every gwtrequest to see if the user has the right to access. if so, the application is more secure but have to process much more extra payloads.
2. If i just use the login authentication but does not check every gwt requests after that, is there risk that un-authorized people may be able to access my app? Does requestfactory automatically have ways to protected this?

Thanks.

Nuno Rosa

unread,
Aug 17, 2011, 6:09:01 AM8/17/11
to google-we...@googlegroups.com
RequestFactory accepts a parameter to define a UserInformation class, you should implement this class with your authentication mechanism.
If this parameter is available requestfactory will call the isUserLoggedIn method before processing the call.
Check RequestFactoryFactoryServlet implementation. http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java

This is how we define the parameters on web.xml

<servlet>
<servlet-name>requestFactoryServlet</servlet-name>
<servlet-class>com.google.gwt.requestfactory.server.RequestFactoryServlet</servlet-class>
<init-param>
<param-name>userInfoClass</param-name>
<param-value>com.example.server.UserInformationImpl</param-value>
<init-param>
</servlet>


2011/8/17 July <gsu...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/h0Nx1ecMf2sJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

July

unread,
Aug 17, 2011, 6:42:34 AM8/17/11
to google-we...@googlegroups.com
Thanks for reply, but seem both links you provided can not be opened. i use GWT2.3 and seem no UserInformation defined?

BST

unread,
Aug 17, 2011, 6:53:42 AM8/17/11
to google-we...@googlegroups.com
http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/gwt/requestfactory/server/RequestFactoryServlet.html

Message in the above link

RequestFactory has moved to com.google.web.bindery.requestfactory. This package will be removed in a future version of GWT.

Jens

unread,
Aug 17, 2011, 7:00:05 AM8/17/11
to google-we...@googlegroups.com
The UserInformation class is old. 

You have to write a ServletFilter that does the authentication for every request and you may also want a custom RequestTransport implementation for RequestFactory. Take a look at the mobilewebapp sample in GWT 2.4 release branch or trunk to see how you can implement it.

-- J.

Mihail Lesikov

unread,
Aug 17, 2011, 7:08:28 AM8/17/11
to google-we...@googlegroups.com

July

unread,
Aug 17, 2011, 10:25:28 AM8/17/11
to google-we...@googlegroups.com
very helpful, Thank you all for the help
Reply all
Reply to author
Forward
0 new messages