Interface UserService (2.0.0)

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

where the user will be redirected after they log in.

Returns
TypeDescription
String

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

where the user will be redirected after they log in.

authDomain@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

not used.

Returns
TypeDescription
String

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

where the user will be redirected after they log in.

authDomainString

not used.

federatedIdentityString

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.

attributesRequestSet<String>

not used.

Returns
TypeDescription
String

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

where the user will be redirected after they log out.

Returns
TypeDescription
String

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

where the user will be redirected after they log out.

authDomain@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

not used.

Returns
TypeDescription
String

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
TypeDescription
@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.users.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
TypeDescription
boolean

isUserLoggedIn()

public abstract boolean isUserLoggedIn()

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

Returns
TypeDescription
boolean