# Interface UserService (5.0.3)

    public interface 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.

## Methods

### createLoginURL(String destinationURL)

    public abstract String createLoginURL(String destinationURL)

Returns a URL that can be used to display a login page to the user.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `destinationURL` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` where the user will be redirected after they log in. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The URL that will present a login prompt. |

### createLoginURL(String destinationURL, @Nullable String authDomain)

    public abstract String createLoginURL(String destinationURL, @Nullable String authDomain)

Returns a URL that can be used to display a login page to the user.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationURL` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` where the user will be redirected after they log in. |
| `authDomain` | `https://docs.oracle.com/javase/8/docs/api/java/lang/@org/jspecify/annotations/Nullable String.html` not used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The URL that will present a login prompt. |

### createLoginURL(String destinationURL, String authDomain, String federatedIdentity, Set\<String\> attributesRequest) (deprecated)

    public abstract String createLoginURL(String destinationURL, String authDomain, String federatedIdentity, Set<String> attributesRequest)

**Deprecated.** *Use of federatedIdentity is no longer supported. Please change calls to a method
that does not take the parameter.*

Returns a URL that can be used to redirect the user to a third party for federated login.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationURL` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` where the user will be redirected after they log in. |
| `authDomain` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` not used. |
| `federatedIdentity` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Setting this parameter to a non-null value will throw an IllegalArgumentException. OpenID 2.0 support has been decommissioned. Please see <https://cloud.google.com/appengine/docs/deprecations/open_id> for details. |
| `attributesRequest` | `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` not used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The URL that will present a login prompt. |

### createLogoutURL(String destinationURL)

    public abstract String createLogoutURL(String destinationURL)

Returns a URL that can be used to log the current user out of this app.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `destinationURL` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` where the user will be redirected after they log out. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The URL that will log the user out. |

### createLogoutURL(String destinationURL, @Nullable String authDomain)

    public abstract String createLogoutURL(String destinationURL, @Nullable String authDomain)

Returns a URL that can be used to log the current user out of this app.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationURL` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` where the user will be redirected after they log out. |
| `authDomain` | `https://docs.oracle.com/javase/8/docs/api/java/lang/@org/jspecify/annotations/Nullable String.html` not used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The URL that will log the user out. |

### getCurrentUser()

    public abstract @Nullable User getCurrentUser()

If the user is logged in, this method will return a `User` that
contains information about them.

Note that repeated calls may not necessarily return the same
`User` object.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.appengine.api.users.@org.jspecify.annotations.Nullable User` | User if the user is logged in, null otherwise. |

### isUserAdmin()

    public abstract boolean isUserAdmin()

Returns true if the user making this request is an admin for this
application, false otherwise.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isUserLoggedIn()

    public abstract boolean isUserLoggedIn()

Returns true if there is a user logged in, false otherwise.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |