Skip to content

Commit 3b33cdc

Browse files
ddoughertyIanNiLewis
authored andcommitted
Doc merge from master:Training class on Identifying and Authenticating Users.
Conflicts: docs/html/training/id-auth/authenticate.jd docs/html/training/id-auth/custom_auth.jd docs/html/training/id-auth/identify.jd docs/html/training/id-auth/index.jd Change-Id: I73174b2cb923ec5d28b551f27d0512d427616c69
1 parent 6fbddff commit 3b33cdc

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed
97 KB
Loading

docs/html/training/id-auth/authenticate.jd

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
page.title=Authenticating to OAuth2 Services
2-
parent.title=Identifying and Authenticating Users
1+
page.title=Authenticating to OAuth2 Services
2+
parent.title=Remembering and Authenticating Users
33
parent.link=index.html
44

55
trainingnavtop=true
6-
previous.title=Identifying Your User
6+
previous.title=Remembering Your User
77
previous.link=identify.html
88
next.title=Creating a Custom Account Type
99
next.link=custom_auth.html
@@ -72,25 +72,24 @@ API.</li>
7272

7373
<h2 id="RequestToken">Request an Auth Token</h2>
7474

75-
<p>Now you're ready to request an auth token. Auth tokens usually expire after
76-
some period of time, so you'll have to renew them.</p>
75+
<p>Now you're ready to request an auth token. This is a multi-step process.</p>
7776

78-
<!-- TODO: I think a flowchart would be useful here, or perhaps a link to an as-yet-to-be-created
79-
flowchart that lives in the docs. -->
77+
<img src="{@docRoot}images/training/oauth_dance.png" alt="Procedure for obtaining
78+
a valid auth token from the Android Account Manager"/>
8079

8180
<p>To get an auth token you first need to request the
8281
{@link android.Manifest.permission#ACCOUNT_MANAGER}
8382
to yourmanifest file. To actually do anything useful with the
8483
token, you'll also need to add the {@link android.Manifest.permission#INTERNET}
8584
permission.</p>
8685

87-
<code>
86+
<pre>
8887
&lt;manifest ... >
8988
&lt;uses-permission android:name="android.permission.ACCOUNT_MANAGER" /&gt;
9089
&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
9190
...
9291
&lt;/manifest>
93-
</code>
92+
</pre>
9493

9594

9695
<p>Once your app has these permissions set, you can call {@link

docs/html/training/id-auth/custom_auth.jd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
page.title=Creating a Custom Account Type
2-
parent.title=Identifying and Authenticating Users
1+
page.title=Creating a Custom Account Type
2+
parent.title=Remembering and Authenticating Users
33
parent.link=index.html
44

55
trainingnavtop=true
@@ -28,8 +28,9 @@ SampleSyncAdapter app</a></li>
2828
</div>
2929
</div>
3030

31-
<p>In the previous lessons, we've talked about using Google accounts to identify Google users and
32-
access Google APIs. But what if you've got your own online service? It turns out
31+
<p>So far we've talked about accessing Google APIs, which use accounts and users
32+
defined by Google. If you have your own online service, though, it won't have
33+
Google accounts or users, so what do you do? It turns out
3334
to be relatively straightforward to install new account types on a user's
3435
device. This lesson explains how to create a custom account type that works the
3536
same way as the built-in accounts do. </p>

docs/html/training/id-auth/identify.jd

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
page.title=Identifying Your User
2-
parent.title=Identifying and Authenticating Users
1+
page.title=Remembering Your User
2+
parent.title=Remembering and Authenticating Users
33
parent.link=index.html
44

55
trainingnavtop=true
@@ -17,8 +17,8 @@ next.link=authenticate.html
1717
<li><a href="#TaskTwo">Decide What Type of Account to Use</a></li>
1818
<li><a href="#GetPermission">Request GET_ACCOUNT permission</a></li>
1919
<li><a href="#TaskFive">Query AccountManager for a List of Accounts</a></li>
20-
<li><a href="#IdentifyUser">Use the Account Object to Identify the User</a></li>
21-
<li><a href="#IdIsEnough">Decide Whether Identification is Enough</a></li>
20+
<li><a href="#IdentifyUser">Use the Account Object to Personalize Your App</a></li>
21+
<li><a href="#IdIsEnough">Decide Whether an Account Name is Enough</a></li>
2222
</ol>
2323
</div>
2424
</div>
@@ -31,8 +31,8 @@ a tablet as well as a phone. But how do you know who your user is? And how do
3131
you recognize them on a new device?</p>
3232

3333
<p>For many applications, the answer is the {@link android.accounts.AccountManager} APIs. With the
34-
user's permission, you can use Account Manager to uniquely identify a user
35-
by the online identity that the user has stored on their device.</p>
34+
user's permission, you can use Account Manager to fetch the account names
35+
that the user has stored on their device.</p>
3636

3737
<p>Integration with the user's accounts allows you to do a variety of things such as:</p>
3838
<ul>
@@ -43,10 +43,10 @@ by the online identity that the user has stored on their device.</p>
4343

4444
<h2 id="ForYou">Determine if AccountManager for You</h2>
4545

46-
<p>Applications typically identify the user in three different ways:</p>
46+
<p>Applications typically try to remember the user using one of three techniques:</p>
4747
<ol type="a">
4848
<li>Ask the user to type in a username </li>
49-
<li>Use a unique device identifier rather than a user identifier</li>
49+
<li>Retrieve a unique device ID to remember the device</li>
5050
<li>Retrieve a built-in account from {@link android.accounts.AccountManager}</li>
5151
</ol>
5252

@@ -63,7 +63,7 @@ your app no longer remembers them.</p>
6363

6464
<p>Option (c) is the preferred technique. Account Manager allows you to get
6565
information about the accounts that are stored on the user's device. As we'll
66-
see in this lesson, using Account Manager lets you identify your user, no matter
66+
see in this lesson, using Account Manager lets you remember your user, no matter
6767
how many devices the user may own, by adding just a couple of extra taps to your
6868
UI.</p>
6969

@@ -113,7 +113,7 @@ Account[] accounts = am.getAccountsByType("com.google");
113113
the array, you should present a dialog asking the user to select one.</p>
114114

115115

116-
<h2 id="IdentifyUser">Use the Account Object to Identify the User</h2>
116+
<h2 id="IdentifyUser">Use the Account Object to Personalize Your App</h2>
117117

118118
<p>The {@link android.accounts.Account} object contains an account name, which for Google accounts
119119
is an
@@ -126,12 +126,12 @@ hand.</li>
126126
</p>
127127

128128

129-
<h2 id="IdIsEnough">Decide Whether Identification is Enough</h2>
129+
<h2 id="IdIsEnough">Decide Whether an Account Name is Enough</h2>
130130

131-
<p>Account names are a good way to identify the user, but the {@link android.accounts.Account}
131+
<p>An account name is a good way to remember the user, but the {@link android.accounts.Account}
132132
object by
133-
itself doesn't protect your data or give you access to anything. If you intend
134-
to access private data, you'll need something stronger: authentication.
133+
itself doesn't protect your data or give you access to anything besides the user's account name. If your app
134+
needs to allow the user to go online to access private data, you'll need something stronger: authentication.
135135
The next lesson explains how to authenticate to existing online services. The lesson after that
136136
deals with writing a custom authenticator so that you can install your own
137137
account types.</p>

docs/html/training/id-auth/index.jd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
page.title=Identifying Users
1+
page.title=Remembering Users
22

33
trainingnavtop=true
44
startpage=true
5-
next.title=Identifying Your User
5+
next.title=Remembering Your User
66
next.link=identify.html
77

88
@jd:body
@@ -39,7 +39,7 @@ make your application a richer, more personal experience.</p>
3939
user's identity, enabling you to:</p>
4040

4141
<ul>
42-
<li>Identify the user by detecting and selecting an account
42+
<li>Personalize your app by remembering users by their account name(s)
4343
<li>Authenticate the user to make sure they are who they say they are
4444
<li>Gain permission to access the user's online data via services like
4545
the Google APIs
@@ -51,7 +51,7 @@ back-end services
5151
<h2>Lessons</h2>
5252

5353
<dl>
54-
<dt><b><a href="identify.html">Identifying Your User</a></b></dt>
54+
<dt><b><a href="identify.html">Remembering Your User</a></b></dt>
5555
<dd>Use {@link android.accounts.AccountManager} to learn the user's account name(s).</dd>
5656

5757
<dt><b><a href="authenticate.html">Authenticating to OAuth2 Services</a></b></dt>

0 commit comments

Comments
 (0)