Skip navigation links

Package com.google.appengine.api.users

Provides facilities to check if a user has authenticated, retrieve their email address, and check if they are an administrator for this application.

See: Description

Package com.google.appengine.api.users Description

Provides facilities to check if a user has authenticated, retrieve their email address, and check if they are an administrator for this application. It can also be used to construct a URL for users to login or logout.

As an example, your application might, in a JSP file, have code like this:


 <%
   UserService userService = UserServiceFactory.getUserService();
   if (!userService.isUserLoggedIn()) {
 %>
    Please {@code <a href="<%=userService.createLoginURL("/newlogin.jsp")>">log in</a>>}
 <% } else { %>
    Welcome, <%= userService.getCurrentUser().getNickname(); %>!
      {@code (<a href="<%=userService.createLogoutURL("/")>">log out</a>>)}
 <%
   }
 %>
 
See Also:
UserService, The Users Java API in the Google App Engine Developer's Guide.
Skip navigation links
Java is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.