From 292bed2055ee6f76fb0b5b9374f360f8cabaf97f Mon Sep 17 00:00:00 2001
From: Robert Ly
- Google Play services offers a standard authentication flow for all Google APIs and
- all components of Google Play services. In addition, you can leverage the authentication
- portion of the Google Play services SDK to authenticate to services that are not yet supported
- in the Google Play services platform by using the authentication token to manually make API
+ Google Play services offers a standard authorization flow for all Google APIs and
+ all components of Google Play services. In addition, you can leverage the authorization
+ portion of the Google Play services SDK to gain authorization to services that are not yet supported
+ in the Google Play services platform by using the access token to manually make API
requests or using a client library provided by the service provider.
For implementation details, see the sample in For implementation details, see the sample in
Google Play services leverage existing accounts on an Android-powered device
- to authenticate to the services that you want to use. To obtain an authorization token,
+ to gain authorization to the services that you want to use. To obtain an access token,
a valid Google account is required and it must exist on the device. You can ask your users which
account they want to use by enumerating the Google accounts on the device or using the
built-in
@@ -39,7 +39,7 @@ AccountPicker}In this document
<android-sdk>/extras/google-play-services/samples/auth, which shows you how
-to carry out these basic steps for obtaining an authentication token.<android-sdk>/extras/google-play-services/samples/auth,
+which shows you how to carry out these basic steps for obtaining an acesss token.Choosing an Account
For example, here's how to gather all of the Google accounts on a device and return them - in an array. When obtaining an authorization token, only the email address of the account is + in an array. When obtaining an access token, only the email address of the account is needed, so that is what the array stores:
@@ -55,24 +55,24 @@ private String[] getAccountNames() { return names; } -- With an email address, you can now obtain an authorization token. There are two general + With an email address, you can now obtain an access token. There are two general ways to get a token:
HelloActivity mActivity;
String mEmail;
@@ -90,13 +90,13 @@ try {
Call this method off of the main UI thread since it executes network transactions. An easy way to do this
is in an {@link android.os.AsyncTask}.
The sample in the Google Play services SDK shows you how to wrap this call in an AsyncTask.
- If authentication is successful, the token is returned. If not, the exceptions described in
+ If authorization is successful, the token is returned. If not, the exceptions described in
Handling Exceptions
are thrown that you can catch and handle appropriately.
Using getTokenWithNotification()
- If you are obtaining authentication tokens in a background service or sync adapter, there
+
If you are obtaining access tokens in a background service or sync adapter, there
are three overloaded
{@code getTokenWithNotification()} methods
@@ -104,11 +104,11 @@ try {
syncBundle parameter.- When requesting an authentication token with + When requesting an access token with {@code GoogleAuthUtil.getToken()}, the following exceptions can be thrown: @@ -167,7 +167,7 @@ app to access the account, the sync adapter retries syncing with the information {@code GoogleAuthException}: This exception is thrown when the authorization fails, such as when an invalid scope is - specified or if the email address used to authenticate is actually not on the user's + specified or if the email address used for authorization is actually not on the user's device.
Once you have successfully obtained a token, you can use it to access Google services. Many Google services provide client libraries, so it is recommended that you use these when @@ -224,7 +224,7 @@ if (serverCode == 200) {
Notice that you must manually invalidate the token if the response from the server
- signifies an authentication error (401). This could mean the authentication token
+ signifies an authorization error (401). This could mean the access token
being used is invalid for the service's scope or the token may have expired. If this is the
case, obtain a new token using
- Manage App Distribution and Licensing
-
-
- Google Play allows you to manage your app distribution with features that let you control which users
- can download your app as well as deliver separate versions of your app based on certain
- characteristics like platform version.
-
- Make sure your app gets to the right users by filtering on a wide range of characteristics
- such as platform versions and hardware features.
-
- Distribute different APKs based on a variety of properties such as platform version, screen
- size, and GLES texture compression support.
-
- Tap into Google's content delivery services by serving up to 4GB of assets for free. Provide
- users with high-fidelity graphics, media files, or other large assets that are required by
- your app.
- Protect your revenue streams and integrate policies for usage into your app.
- All products in Google Play services share a common authentication API
+ All products in Google Play services share a common authorization API
that leverages the existing Google accounts on the device. You and your
- users have a consistent and safe way to grant and receive OAuth2 authentication
+ users have a consistent and safe way to grant and receive OAuth2 access tokens
to Google services.
- Device Filtering
-
-
- Multiple APK Support
-
-
- APK Expansion files
-
-
- Application Licensing
-
- Standard Authentication
-Standard Authorization
+
The client library contains the interfaces to the individual Google - services and allows you to obtain authorization from users to authenticate + services and allows you to obtain authorization from users to gain access to these services with their credentials. It also contains APIs that allow you to resolve any issues at runtime, such as a missing, disabled, or out-of-date Google Play services APK. The client library has a light footprint if you use @@ -90,7 +90,7 @@ about your users' Android version.
The Google Play services APK contains the individual Google services and runs as a background service in the Android OS. You interact with the background service through the client library and the service carries out the actions on your behalf. - An easy-to-use authentication flow is also + An easy-to-use authorization flow is also provided to gain access to the each Google service, which provides consistency for both you and your users. -- cgit v1.2.3-59-g8ed1b