small medium large xlarge

02 Mar 2011, 06:01
Stephen Moss (3 posts)

I’ve managed to get the Chat application in Java up and running. One thing I’m struggling to get up and running is the concept of authenticating a user using GWT/Java, i.e. detecting if someone is logged in and re-directing them to the login URL if they aren’t before posting a message. Also, how is a “Login” type function implemented on the HTML page?

At the moment I’m using a hack in the postMessage server method to set the user name to “Guest” if the user isn’t logged in. Is this something that you will be covering in a later version of the book, or is there some advice on how to get this to work?

16 May 2011, 00:18
Mark Chu-Carroll (14 posts)

In Java, you don’t need to implement your own login. You just put an annotation in the applications app.yaml configuration, which says that the URL requires login:

- url: /path-to-your-app
  login: required
  You must be logged in to comment