Security when using GWT RPC

Posted by gerdemb on Stack Overflow See other posts from Stack Overflow or by gerdemb
Published on 2010-05-21T19:19:20Z Indexed on 2010/05/21 19:40 UTC
Read the original article Hit count: 267

Filed under:
|
|
|
|

I have an POJO in Google Web Toolkit like this that I can retrieve from the server.

class Person implements Serializable {
  String name;
  Date creationDate;
}

When the client makes changes, I save it back to the server using the GWT RemoteServiceServlet like this:

rpcService.saveObject(myPerson,...)

The problem is that the user shouldn't be able to change the creationDate. Since the RPC method is really just a HTTP POST to the server, it would be possible to modify the creationDate by changing the POST request.

A simple solution would be to create a series of RPC functions like changeName(String newName), etc., but with a class with many fields would require many methods for each field, and would be inefficient to change many fields at once.

I like the simplicity of having a single POJO that I can use on both the server and GWT client, but need a way to do it securely. Any ideas?

© Stack Overflow or respective owner

Related posts about gwt

Related posts about java