com.amazonaws.auth
Class AWSAbstractCognitoIdentityProvider

java.lang.Object
  extended by com.amazonaws.auth.AWSAbstractCognitoIdentityProvider
All Implemented Interfaces:
AWSCognitoIdentityProvider, AWSIdentityProvider
Direct Known Subclasses:
AWSAbstractCognitoDeveloperIdentityProvider, AWSBasicCognitoIdentityProvider, AWSEnhancedCognitoIdentityProvider

public abstract class AWSAbstractCognitoIdentityProvider
extends java.lang.Object
implements AWSCognitoIdentityProvider

This class utilizes Cognito as a means to get an identity and dispense an identityId and token. It also handles the refreshing of the token and identityId.


Constructor Summary
AWSAbstractCognitoIdentityProvider(java.lang.String accountId, java.lang.String identityPoolId)
          Deprecated. please use AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, Regions region) instead.
AWSAbstractCognitoIdentityProvider(java.lang.String accountId, java.lang.String identityPoolId, AmazonCognitoIdentity cibClient)
          Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the baseline for both Cognito and developer trusted identity providers.
AWSAbstractCognitoIdentityProvider(java.lang.String accountId, java.lang.String identityPoolId, ClientConfiguration clientConfiguration, Regions region)
          Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the baseline for both Cognito and developer trusted identity providers.
 
Method Summary
 void clearListeners()
          To be used to empty all registered listeners from the identity provider
 java.lang.String getAccountId()
           
 java.lang.String getIdentityId()
          Gets a reference to the identityId of the user (sending a new request if it isn't yet set), using the dev accountId, identityPoolId, and the user's loginsMap to identify.
 java.lang.String getIdentityPoolId()
          Get the identityPoolId from the provider
 java.util.Map<java.lang.String,java.lang.String> getLogins()
          Get the logins from the provider
abstract  java.lang.String getProviderName()
          Gets a string with the name of the provider being used.
 java.lang.String getToken()
          With the logins and identityId to mark the user, it builds a request to the cognito back end, and returns the token cib hands back
 void identityChanged(java.lang.String newIdentityId)
          Updates the listeners and establishes the new identityId as the stored identityId
 boolean isAuthenticated()
          Checks if the current identityId belongs to an authenticated user
 java.lang.String refresh()
          To be used to call the provider back end to get a token and identityId.
 void registerIdentityChangedListener(IdentityChangedListener listener)
          Handles the new version of an identity changed listener to be handled by the provider
 void setLogins(java.util.Map<java.lang.String,java.lang.String> logins)
          Pass the logins to the provider
 void unregisterIdentityChangedListener(IdentityChangedListener listener)
          Handles the removing of a version of an identity changed listener from the list with the provider
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWSAbstractCognitoIdentityProvider

public AWSAbstractCognitoIdentityProvider(java.lang.String accountId,
                                          java.lang.String identityPoolId,
                                          AmazonCognitoIdentity cibClient)
Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the baseline for both Cognito and developer trusted identity providers. Custom providers should not extend this class, but should extend AWSAbstractCognitoDeveloperIdentityProvider

Parameters:
accountId - the accountId of the developer
identityPoolId - the identityPoolId to be used
cibClient - the cib client which will communicate with cognito

AWSAbstractCognitoIdentityProvider

public AWSAbstractCognitoIdentityProvider(java.lang.String accountId,
                                          java.lang.String identityPoolId,
                                          ClientConfiguration clientConfiguration,
                                          Regions region)
Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the baseline for both Cognito and developer trusted identity providers. Custom providers should not extend this class, but should extend AWSAbstractCognitoDeveloperIdentityProvider

Parameters:
accountId - the accountId of the developer
identityPoolId - the identityPoolId to be used
clientConfiguration - the client configuration to be used by the client
region - the region cognito will use

AWSAbstractCognitoIdentityProvider

@Deprecated
public AWSAbstractCognitoIdentityProvider(java.lang.String accountId,
                                                     java.lang.String identityPoolId)
Deprecated. please use AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, Regions region) instead.

Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the baseline for both Cognito and developer trusted identity providers. Custom providers should not extend this class, but should extend AWSAbstractCognitoDeveloperIdentityProvider

Parameters:
accountId - the accountId of the developer
identityPoolId - the identityPoolId to be used
Method Detail

getProviderName

public abstract java.lang.String getProviderName()
Gets a string with the name of the provider being used. For example, Cognito would return "Cognito";

Returns:
the name of the provider in a string

getIdentityId

public java.lang.String getIdentityId()
Gets a reference to the identityId of the user (sending a new request if it isn't yet set), using the dev accountId, identityPoolId, and the user's loginsMap to identify.

Specified by:
getIdentityId in interface AWSCognitoIdentityProvider
Returns:
the identityId of the user

getToken

public java.lang.String getToken()
With the logins and identityId to mark the user, it builds a request to the cognito back end, and returns the token cib hands back

Specified by:
getToken in interface AWSIdentityProvider
Returns:
the token which was retrieved from the provider

getIdentityPoolId

public java.lang.String getIdentityPoolId()
Description copied from interface: AWSCognitoIdentityProvider
Get the identityPoolId from the provider

Specified by:
getIdentityPoolId in interface AWSCognitoIdentityProvider
Returns:
the identityPoolId

getAccountId

public java.lang.String getAccountId()

getLogins

public java.util.Map<java.lang.String,java.lang.String> getLogins()
Description copied from interface: AWSCognitoIdentityProvider
Get the logins from the provider

Specified by:
getLogins in interface AWSCognitoIdentityProvider
Returns:
the logins map

setLogins

public void setLogins(java.util.Map<java.lang.String,java.lang.String> logins)
Description copied from interface: AWSCognitoIdentityProvider
Pass the logins to the provider

Specified by:
setLogins in interface AWSCognitoIdentityProvider
Parameters:
logins - the logins map

isAuthenticated

public boolean isAuthenticated()
Description copied from interface: AWSCognitoIdentityProvider
Checks if the current identityId belongs to an authenticated user

Specified by:
isAuthenticated in interface AWSCognitoIdentityProvider
Returns:
true if the identity is authenticated

unregisterIdentityChangedListener

public void unregisterIdentityChangedListener(IdentityChangedListener listener)
Description copied from interface: AWSCognitoIdentityProvider
Handles the removing of a version of an identity changed listener from the list with the provider

Specified by:
unregisterIdentityChangedListener in interface AWSCognitoIdentityProvider
Parameters:
listener - the listener to be removed

registerIdentityChangedListener

public void registerIdentityChangedListener(IdentityChangedListener listener)
Description copied from interface: AWSCognitoIdentityProvider
Handles the new version of an identity changed listener to be handled by the provider

Specified by:
registerIdentityChangedListener in interface AWSCognitoIdentityProvider
Parameters:
listener - the new listener to be registered

identityChanged

public void identityChanged(java.lang.String newIdentityId)
Updates the listeners and establishes the new identityId as the stored identityId

Specified by:
identityChanged in interface AWSCognitoIdentityProvider
Parameters:
newIdentityId - the identityId to be saved

clearListeners

public void clearListeners()
Description copied from interface: AWSCognitoIdentityProvider
To be used to empty all registered listeners from the identity provider

Specified by:
clearListeners in interface AWSCognitoIdentityProvider

refresh

public java.lang.String refresh()
Description copied from interface: AWSIdentityProvider
To be used to call the provider back end to get a token and identityId. Once that has returned, a call to the superclass' update(String, Token) method should be called

Specified by:
refresh in interface AWSIdentityProvider
Returns:
token returns the token that was updated in the refresh


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.