Ok, that's what I did ..
The problem is that I don't see the user == null when I log out from
the OpenID provide (Gmail for example)

On Oct 19, 12:05 am, Sudhakar Abraham <[email protected]>
wrote:
> Get the userService object  from the UserServiceFactory class in
> google app engine api.   Invoke the getCurrentUser() method in
> userService object.  Check whether the user is alive or not. if user
> is alive call the createLogoutURL(pass_your_ logout_ url), or call the
> createLoginURL(pass_your _login _url)  in UserService object.
>
> S. Abrahamwww.DataStoreGwt.com
> Persist objects directly in Google App Engine
>
> //In Jsp page
>
> <%@ page import="com.google.appengine.api.users.User" %>
> <%@ page import="com.google.appengine.api.users.UserService" %>
> <%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
> <%
> UserService userService = UserServiceFactory.getUserService();
> User user = userService.getCurrentUser();
> %>
>
> <%if (user != null) {%>
>   <a href="<%= userService.createLogoutURL(request.getRequestURI())
> %>">
>     Sign out <%=user.getNickname()%>
>   </a>
> <%} else {%>
>   <a href="<%= userService.createLoginURL(request.getRequestURI())
> %>">
>     Sign in
>   </a>
> <%}%>
>
> On Oct 18, 12:26 pm, Miguel <[email protected]> wrote:
>
>
>
>
>
>
>
> > I don't understand if it is a bug or I am doing something wrong ..
>
> > I am using the federated login: when I logout from Google I still
> > remain logged in my web-application.
>
> > I do the authentication in that way .. Is it wrong?
>
> > UserService userService = UserServiceFactory.getUserService();
> > User loggedUser = userService.getCurrentUser();
> > ..
> > if(loggedUser!=null) {
> > ..
>
> > } else {
> > ..
> > }
>
> > Even if I am logged out by google the "loggedUser" I cannot pass by
> > the "else" statement. The loggedUser is always different from null ..
>
> > Why? What am I doing wrong?

-- 
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