Being logged into other Google services doesn't guarantee that you'll be
logged into the App Engine app. Users need to individually log into your
application with their Google Account. You'll need to call createLoginUrl.
Take a look at the docs here:

http://code.google.com/appengine/docs/java/gettingstarted/usingusers.html

Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine



On Tue, Apr 12, 2011 at 10:48 PM, Fabrizio Accatino <[email protected]>wrote:

> Have you activated Security & Authentication in the web.xml?
>
>
> http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication
>
>
>
> <http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication>
>   fabrizio
>
>
> On Wed, Apr 13, 2011 at 7:44 AM, Peter <[email protected]> wrote:
>
>> Folks,
>>
>> I am a bit confused on how to use user services correctly.
>>
>> Here is the relevant code snippet:
>>
>> public class GreetingServiceImple extends RemoteServiceServlet implements
>> GreetingService {
>>
>>    public string greetServer() {
>>         UserService us = UserServiceFactory.getUserService();
>>         User user = us.getCurrentUser();
>>         ...
>>    }
>> }
>>
>> The problem is, the value returned by getCurrentUser is always null,
>> irrespective of whether I deploy locally or at appspot.
>>
>> I am using Firefox as the client. I have two tabs open. On one tab, I am
>> signed into Google mail using my gmail account. On the other tab, I am
>> trying to run the app that I am working on.
>>
>> What is it that I am missing?
>>
>> Thank you in advance for your help.
>>
>> Regards,
>> Peter
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to