Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

com.google.appengine.api.users (Google App Engine API for Java)

Stay organized with collections Save and categorize content based on your preferences.

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

  • Interface Summary 
    Interface Description
    IUserServiceFactory
    This interface should be implemented by providers of the UserService and registered with com.google.appengine.spi.ServiceFactoryFactory.
    UserService
    The UserService provides information useful for forcing a user to log in or out, and retrieving information about the user who is currently logged-in.
  • Class Summary 
    Class Description
    IUserServiceFactoryProvider
    Creates IUserServiceFactory implementations.
    User
    User represents a specific user, represented by the combination of an email address and a specific Google Apps domain (which we call an authDomain).
    UserServiceFactory
    Creates a UserService.
  • Exception Summary 
    Exception Description
    UserServiceFailureException
    UserServiceFailureException is thrown when any unknown error occurs while communicating with the user service.

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.