<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-v4) on Fri Sep 09 16:39:34 CDT 2011 --> <TITLE> UserService </TITLE> <META NAME="date" CONTENT="2011-09-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="UserService"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/users/User.html" title="class in com.google.appengine.api.users"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/users/UserServiceFactory.html" title="class in com.google.appengine.api.users"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/users/UserService.html" target="_top"><B>FRAMES</B></A> <A HREF="UserService.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.appengine.api.users</FONT> <BR> Interface UserService</H2> <HR> <DL> <DT><PRE>public interface <B>UserService</B></DL> </PRE> <P> 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. <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#createLoginURL(java.lang.String)">createLoginURL</A></B>(java.lang.String destinationURL)</CODE> <BR> Returns an URL that can be used to display a login page to the user.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#createLoginURL(java.lang.String, java.lang.String)">createLoginURL</A></B>(java.lang.String destinationURL, java.lang.String authDomain)</CODE> <BR> Returns an URL that can be used to display a login page to the user.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#createLoginURL(java.lang.String, java.lang.String, java.lang.String, java.util.Set)">createLoginURL</A></B>(java.lang.String destinationURL, java.lang.String authDomain, java.lang.String federatedIdentity, java.util.Set<java.lang.String> attributesRequest)</CODE> <BR> Returns an URL that can be used to redirect the user to for third party login for federated login the user.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#createLogoutURL(java.lang.String)">createLogoutURL</A></B>(java.lang.String destinationURL)</CODE> <BR> Returns an URL that can be used to log the current user out of this app.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#createLogoutURL(java.lang.String, java.lang.String)">createLogoutURL</A></B>(java.lang.String destinationURL, java.lang.String authDomain)</CODE> <BR> Returns an URL that can be used to log the current user out of this app.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../com/google/appengine/api/users/User.html" title="class in com.google.appengine.api.users">User</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#getCurrentUser()">getCurrentUser</A></B>()</CODE> <BR> If the user is logged in, this method will return a <code>User</code> that contains information about them.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#isUserAdmin()">isUserAdmin</A></B>()</CODE> <BR> Returns true if the user making this request is an admin for this application, false otherwise.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/users/UserService.html#isUserLoggedIn()">isUserLoggedIn</A></B>()</CODE> <BR> Returns true if there is a user logged in, false otherwise.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="createLoginURL(java.lang.String)"><!-- --></A><H3> createLoginURL</H3> <PRE> java.lang.String <B>createLoginURL</B>(java.lang.String destinationURL)</PRE> <DL> <DD>Returns an URL that can be used to display a login page to the user. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>destinationURL</CODE> - where the user will be redirected after they log in. <DT><B>Returns:</B><DD>The URL that will present a login prompt. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - If the destinationURL is not valid.</DL> </DD> </DL> <HR> <A NAME="createLoginURL(java.lang.String, java.lang.String)"><!-- --></A><H3> createLoginURL</H3> <PRE> java.lang.String <B>createLoginURL</B>(java.lang.String destinationURL, java.lang.String authDomain)</PRE> <DL> <DD>Returns an URL that can be used to display a login page to the user. For trusted apps only. If the calling app does not have permission to use this feature, then this will behave just like createLoginURL(destinationURL). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>destinationURL</CODE> - where the user will be redirected after they log in.<DD><CODE>authDomain</CODE> - authentication domain to use. <DT><B>Returns:</B><DD>The URL that will present a login prompt. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - If the destinationURL is not valid.</DL> </DD> </DL> <HR> <A NAME="createLoginURL(java.lang.String, java.lang.String, java.lang.String, java.util.Set)"><!-- --></A><H3> createLoginURL</H3> <PRE> java.lang.String <B>createLoginURL</B>(java.lang.String destinationURL, java.lang.String authDomain, java.lang.String federatedIdentity, java.util.Set<java.lang.String> attributesRequest)</PRE> <DL> <DD>Returns an URL that can be used to redirect the user to for third party login for federated login the user. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>destinationURL</CODE> - where the user will be redirected after they log in.<DD><CODE>federatedIdentity</CODE> - federated identity string which is to be asserted for users who are authenticated using a non-Google ID (e.g., OpenID). In order to use federated logins this feature must be enabled for the application. Otherwise, this should be null.<DD><CODE>authDomain</CODE> - authentication domain to use.<DD><CODE>attributesRequest</CODE> - additional attributions requested for this login, IDP may not may not support these attributes. <DT><B>Returns:</B><DD>The URL that will present a login prompt. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - If the destinationURL is not valid.</DL> </DD> </DL> <HR> <A NAME="createLogoutURL(java.lang.String)"><!-- --></A><H3> createLogoutURL</H3> <PRE> java.lang.String <B>createLogoutURL</B>(java.lang.String destinationURL)</PRE> <DL> <DD>Returns an URL that can be used to log the current user out of this app. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>destinationURL</CODE> - where the user will be redirected after they log out. <DT><B>Returns:</B><DD>The URL that will log the user out. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - If the destinationURL is not valid.</DL> </DD> </DL> <HR> <A NAME="createLogoutURL(java.lang.String, java.lang.String)"><!-- --></A><H3> createLogoutURL</H3> <PRE> java.lang.String <B>createLogoutURL</B>(java.lang.String destinationURL, java.lang.String authDomain)</PRE> <DL> <DD>Returns an URL that can be used to log the current user out of this app. For trusted apps only. If the calling app does not have permission to use this feature, then this will behave just like createLogoutURL(destinationURL). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>destinationURL</CODE> - where the user will be redirected after they log out.<DD><CODE>authDomain</CODE> - authentication domain to use. <DT><B>Returns:</B><DD>The URL that will log the user out. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - If the destinationURL is not valid.</DL> </DD> </DL> <HR> <A NAME="isUserLoggedIn()"><!-- --></A><H3> isUserLoggedIn</H3> <PRE> boolean <B>isUserLoggedIn</B>()</PRE> <DL> <DD>Returns true if there is a user logged in, false otherwise. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="isUserAdmin()"><!-- --></A><H3> isUserAdmin</H3> <PRE> boolean <B>isUserAdmin</B>()</PRE> <DL> <DD>Returns true if the user making this request is an admin for this application, false otherwise. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - If the current user is not logged in.</DL> </DD> </DL> <HR> <A NAME="getCurrentUser()"><!-- --></A><H3> getCurrentUser</H3> <PRE> <A HREF="../../../../../com/google/appengine/api/users/User.html" title="class in com.google.appengine.api.users">User</A> <B>getCurrentUser</B>()</PRE> <DL> <DD>If the user is logged in, this method will return a <code>User</code> that contains information about them. Note that repeated calls may not necessarily return the same <code>User</code> object. <P> <DD><DL> <DT><B>Returns:</B><DD>User if the user is logged in, null otherwise.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/users/User.html" title="class in com.google.appengine.api.users"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/users/UserServiceFactory.html" title="class in com.google.appengine.api.users"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/users/UserService.html" target="_top"><B>FRAMES</B></A> <A HREF="UserService.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>