public abstract class AWSAbstractCognitoIdentityProvider extends Object implements AWSCognitoIdentityProvider
| Modifier and Type | Field and Description |
|---|---|
protected AmazonCognitoIdentity |
cib
The client for communication with Cognito
|
protected String |
identityId
The data structures that won't vary between cognito and developer
providers
|
protected List<IdentityChangedListener> |
listeners |
protected Map<String,String> |
loginsMap |
protected String |
token |
| Constructor and Description |
|---|
AWSAbstractCognitoIdentityProvider(String accountId,
String identityPoolId)
Deprecated.
please use AWSAbstractCognitoIdentityProvider(String
accountId, String identityPoolId, Regions region) instead.
|
AWSAbstractCognitoIdentityProvider(String accountId,
String identityPoolId,
AmazonCognitoIdentity cibClient)
Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the
baseline for both Cognito and developer trusted identity providers.
|
AWSAbstractCognitoIdentityProvider(String accountId,
String identityPoolId,
ClientConfiguration clientConfiguration)
Deprecated.
please use AWSAbstractCognitoIdentityProvider(String
accountId, String identityPoolId, ClientConfiguration
clientConfiguration, Regions region) instead.
|
AWSAbstractCognitoIdentityProvider(String accountId,
String identityPoolId,
ClientConfiguration clientConfiguration,
Regions region)
Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the
baseline for both Cognito and developer trusted identity providers.
|
AWSAbstractCognitoIdentityProvider(String accountId,
String identityPoolId,
Regions region)
Sets up an AWSAbstractCognitoIdentityProvider, which will serve as the
baseline for both Cognito and developer trusted identity providers.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendUserAgent(AmazonWebServiceRequest request,
String userAgent)
Append user agent string to the request.
|
void |
clearListeners()
To be used to empty all registered listeners from the identity provider
|
String |
getAccountId() |
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.
|
String |
getIdentityPoolId()
Get the identityPoolId from the provider
|
Map<String,String> |
getLogins()
Get the logins from the provider
|
abstract String |
getProviderName()
Gets a string with the name of the provider being used.
|
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
|
protected String |
getUserAgent()
Gets the user agent string to append to all requests made by this
provider.
|
void |
identityChanged(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
|
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
|
protected void |
setIdentityId(String identityId) |
void |
setLogins(Map<String,String> logins)
Pass the logins to the provider
|
protected void |
setToken(String token) |
void |
unregisterIdentityChangedListener(IdentityChangedListener listener)
Handles the removing of a version of an identity changed listener from
the list with the provider
|
protected void |
update(String identityId,
String token)
To be used to update the identityId and token after a call to refresh
from an identityProvider.
|
protected final AmazonCognitoIdentity cib
protected String identityId
protected String token
protected List<IdentityChangedListener> listeners
public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, AmazonCognitoIdentity cibClient)
accountId - the accountId of the developeridentityPoolId - the identityPoolId to be usedcibClient - the cib client which will communicate with cognito@Deprecated public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration)
accountId - the accountId of the developeridentityPoolId - the identityPoolId to be usedclientConfiguration - the client configuration to be used by the
clientpublic AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, ClientConfiguration clientConfiguration, Regions region)
accountId - the accountId of the developeridentityPoolId - the identityPoolId to be usedclientConfiguration - the client configuration to be used by the
clientregion - the region cognito will use@Deprecated public AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId)
accountId - the accountId of the developeridentityPoolId - the identityPoolId to be usedpublic AWSAbstractCognitoIdentityProvider(String accountId, String identityPoolId, Regions region)
accountId - the accountId of the developeridentityPoolId - the identityPoolId to be usedregion - the region cib will usepublic abstract String getProviderName()
public String getIdentityId()
getIdentityId in interface AWSCognitoIdentityProviderprotected void setIdentityId(String identityId)
public String getToken()
getToken in interface AWSIdentityProviderprotected void setToken(String token)
public String getIdentityPoolId()
AWSCognitoIdentityProvidergetIdentityPoolId in interface AWSCognitoIdentityProviderpublic String getAccountId()
public Map<String,String> getLogins()
AWSCognitoIdentityProvidergetLogins in interface AWSCognitoIdentityProviderpublic void setLogins(Map<String,String> logins)
AWSCognitoIdentityProvidersetLogins in interface AWSCognitoIdentityProviderlogins - the logins mappublic boolean isAuthenticated()
AWSCognitoIdentityProviderisAuthenticated in interface AWSCognitoIdentityProviderpublic void unregisterIdentityChangedListener(IdentityChangedListener listener)
AWSCognitoIdentityProviderunregisterIdentityChangedListener in interface AWSCognitoIdentityProviderlistener - the listener to be removedpublic void registerIdentityChangedListener(IdentityChangedListener listener)
AWSCognitoIdentityProviderregisterIdentityChangedListener in interface AWSCognitoIdentityProviderlistener - the new listener to be registeredpublic void identityChanged(String newIdentityId)
identityChanged in interface AWSCognitoIdentityProvidernewIdentityId - the identityId to be savedprotected void appendUserAgent(AmazonWebServiceRequest request, String userAgent)
request - the request object to be appendeduserAgent - additional user agent string to appendpublic void clearListeners()
AWSCognitoIdentityProviderclearListeners in interface AWSCognitoIdentityProviderprotected String getUserAgent()
protected void update(String identityId, String token)
identityId - the new identityId to be used for the usertoken - the new token to be used with STSpublic String refresh()
AWSIdentityProviderrefresh in interface AWSIdentityProviderCopyright © 2019. All rights reserved.