public class GoogleSignInProvider extends java.lang.Object implements SignInProvider, SignInPermissionsHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COGNITO_LOGIN_KEY_GOOGLE
The Cognito login key for Google+ to be used in the Cognito login Map.
|
Constructor and Description |
---|
GoogleSignInProvider() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCognitoLoginKey() |
java.lang.String |
getDisplayName() |
int |
getPermissionRequestCode() |
GoogleSignInAccount |
getSignedInAccount()
Get reference to the SignedIn Account.
|
java.lang.String |
getToken()
Call getToken to retrieve the access token from successful sign-in with this provider.
|
void |
handleActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
Call handleActivityResult to handle the activity result.
|
void |
handleRequestPermissionsResult(int requestCode,
java.lang.String[] permissions,
int[] grantResults)
Handler for permissions results.
|
void |
initialize(android.content.Context activityContext,
AWSConfiguration awsConfig)
Constructor.
|
android.view.View.OnClickListener |
initializeSignInButton(android.app.Activity signInActivity,
android.view.View buttonView,
SignInProviderResultHandler providerResultsHandler)
Initialize the sign-in button for the sign-in activity.
|
boolean |
isRequestCodeOurs(int requestCode)
Call isRequestCodeOurs to determine if this provider should handle an activity result.
|
java.lang.String |
refreshToken()
Refreshes the token if it has expired.
|
boolean |
refreshUserSignInState()
Refreshes the state of whether the user is signed-in and returns the updated state.
|
static void |
setPermissions(java.lang.String... loginScopes)
Add the login permisisons needed by the application.
|
void |
signOut()
Call signOut to sign out of this provider.
|
public static final java.lang.String COGNITO_LOGIN_KEY_GOOGLE
public void initialize(android.content.Context activityContext, AWSConfiguration awsConfig)
initialize
in interface IdentityProvider
activityContext
- context.awsConfig
- the AWS Configuration.public java.lang.String getDisplayName()
getDisplayName
in interface IdentityProvider
public boolean refreshUserSignInState()
refreshUserSignInState
in interface IdentityProvider
public static void setPermissions(java.lang.String... loginScopes)
loginScopes
- The list of permissions requiredpublic java.lang.String getCognitoLoginKey()
getCognitoLoginKey
in interface IdentityProvider
public java.lang.String getToken()
getToken
in interface IdentityProvider
public java.lang.String refreshToken()
refreshToken
in interface IdentityProvider
public void signOut()
signOut
in interface IdentityProvider
public boolean isRequestCodeOurs(int requestCode)
isRequestCodeOurs
in interface SignInProvider
requestCode
- the requestCode from a previous call to onActivityResult.public void handleActivityResult(int requestCode, int resultCode, android.content.Intent data)
handleActivityResult
in interface SignInProvider
requestCode
- the request code.resultCode
- the result code.data
- the result intent.public android.view.View.OnClickListener initializeSignInButton(android.app.Activity signInActivity, android.view.View buttonView, SignInProviderResultHandler providerResultsHandler)
initializeSignInButton
in interface SignInProvider
signInActivity
- the activity for sign-in.buttonView
- the view for the sign-in button to initialize.providerResultsHandler
- the resultsHandler for provider sign-in.public GoogleSignInAccount getSignedInAccount()
public int getPermissionRequestCode()
getPermissionRequestCode
in interface SignInPermissionsHandler
public void handleRequestPermissionsResult(int requestCode, java.lang.String[] permissions, int[] grantResults)
handleRequestPermissionsResult
in interface SignInPermissionsHandler
requestCode
- the permissions request codepermissions
- the permissions requestedgrantResults
- the results.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.