Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package com.google.appengine.api.users

The `UserService` provides facilities to check whether a user has authenticated using their Google Account, retrieve their email address, and check whether they are an administrator for this application.

See:
Description

Interface Summary
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
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
UserServiceFailureException | `UserServiceFailureException` is thrown when any unknown error occurs while communicating with the user service.

## Package com.google.appengine.api.users Description

The `UserService` provides facilities to check whether a user has authenticated using their Google Account, retrieve their email address, and check whether they are an administrator for this application. It can also be used to construct a URL for users to login or logout. More information is available in the on-line documentation.

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

       <%
         UserService userService = UserServiceFactory.getUserService();
         if (!userService.isUserLoggedIn()) {
       %>
          Please <A HREF="<%=
              userService.createLoginURL("/newlogin.jsp")
            %>">log in</A>>
       <% } else { %>
          Welcome, <%= userService.currentUser().getNickname(); %>!
            (<A HREF="<%=
                userService.createLogoutURL("/")
              %>">log out</A>>)
       <%
         }
       %>

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES