String userToken = rc.getCookie("userToken");
if (userIdStr != null && userToken != null){
// get the User from the DAO
Long userId = ObjectUtil.getValue(userIdStr, Long.class, null);
User user = PokerUsersListener.getUser(userId);
// Build the expectedUserToken from the user info
// For this example, simplistic userToken (sha1(username,password))
String expectedUserToken = Hashing.sha1().hashString(user.getUsername() + user.getId()).toString();
if (Objects.equal(expectedUserToken, userToken)){
// if valid, then, we create the AuthTocken with our User object
AuthToken<User> authToken = new AuthToken<User>();
authToken.setUser(user);