UserService.getCurrentUser() is not working for me

2010-05-18 Thread Xi Zhang
Hi there:

I am a beginner of GWT.

The problem I am having is I couldn't get Google account
authentication. I simply added UserService.getCurrentUser() to the
default project trying to return the user name trough RPC call but it
didn't work. I tried upload the project to GAE and the result is the
same.

Anyone knows why this is happening?

Thanks,.

Xi Zhang

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



How to user Google account authentication along with RPC?

2010-05-16 Thread Xi Zhang
Hi there:

I am using Google account as authentication of my application. I am
trying to use a RPC call to retrieve the user information using
com.google.appengine.api.users.UserServiceFactory.

So far I have something like:

@SuppressWarnings("serial")
public class MyAppImpl extends  RemoteServiceServlet  implements
MyAppService   {
  public SvUser getUser() {
  User userG = UserServiceFactory.getUserService().getCurrentUser();
 if (userG == null){
return null;
 }else{
 return new SvUser(userG.getUserId(), userG.getNickname(),
userG.getEmail());
  }
 }
}

where SvUser is a serializable DTO. The RPC is working properly,
however I can only get a null as return value, which indicates that I
cannot retrieve anything from Google.

Is there something I am missing in the code? Or it's not working under
development mode?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.