public abstract class AWSAbstractCognitoIdentityProvider extends java.lang.Object implements AWSCognitoIdentityProvider
Modifier and Type | Field and Description |
---|---|
protected AmazonCognitoIdentity |
cib
The client for communication with Cognito
|
protected java.lang.String |
identityId
The data structures that won't vary between cognito and developer
providers
|
protected java.util.List<IdentityChangedListener> |
listeners |
protected java.util.Map<java.lang.String,java.lang.String> |
loginsMap |
protected java.lang.String |
token |
Constructor and Description |
---|
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)
Deprecated.
please use AWSAbstractCognitoIdentityProvider(String
accountId, String identityPoolId, ClientConfiguration
clientConfiguration, Regions region) instead.
|
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.
|
AWSAbstractCognitoIdentityProvider(java.lang.String accountId,
java.lang.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,
java.lang.String userAgent)
Append user agent string to the request.
|
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
|
protected java.lang.String |
getUserAgent()
Gets the user agent string to append to all requests made by this
provider.
|
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
|
protected void |
setIdentityId(java.lang.String identityId) |
void |
setLogins(java.util.Map<java.lang.String,java.lang.String> logins)
Pass the logins to the provider
|
protected void |
setToken(java.lang.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(java.lang.String identityId,
java.lang.String token)
To be used to update the identityId and token after a call to refresh
from an identityProvider.
|
protected final AmazonCognitoIdentity cib
protected java.lang.String identityId
protected java.lang.String token
protected java.util.List<IdentityChangedListener> listeners
protected java.util.Map<java.lang.String,java.lang.String> loginsMap
public AWSAbstractCognitoIdentityProvider(java.lang.String accountId, java.lang.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(java.lang.String accountId, java.lang.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(java.lang.String accountId, java.lang.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(java.lang.String accountId, java.lang.String identityPoolId)
accountId
- the accountId of the developeridentityPoolId
- the identityPoolId to be usedpublic AWSAbstractCognitoIdentityProvider(java.lang.String accountId, java.lang.String identityPoolId, Regions region)
accountId
- the accountId of the developeridentityPoolId
- the identityPoolId to be usedregion
- the region cib will usepublic abstract java.lang.String getProviderName()
public java.lang.String getIdentityId()
getIdentityId
in interface AWSCognitoIdentityProvider
protected void setIdentityId(java.lang.String identityId)
public java.lang.String getToken()
getToken
in interface AWSIdentityProvider
protected void setToken(java.lang.String token)
public java.lang.String getIdentityPoolId()
AWSCognitoIdentityProvider
getIdentityPoolId
in interface AWSCognitoIdentityProvider
public java.lang.String getAccountId()
public java.util.Map<java.lang.String,java.lang.String> getLogins()
AWSCognitoIdentityProvider
getLogins
in interface AWSCognitoIdentityProvider
public void setLogins(java.util.Map<java.lang.String,java.lang.String> logins)
AWSCognitoIdentityProvider
setLogins
in interface AWSCognitoIdentityProvider
logins
- the logins mappublic boolean isAuthenticated()
AWSCognitoIdentityProvider
isAuthenticated
in interface AWSCognitoIdentityProvider
public void unregisterIdentityChangedListener(IdentityChangedListener listener)
AWSCognitoIdentityProvider
unregisterIdentityChangedListener
in interface AWSCognitoIdentityProvider
listener
- the listener to be removedpublic void registerIdentityChangedListener(IdentityChangedListener listener)
AWSCognitoIdentityProvider
registerIdentityChangedListener
in interface AWSCognitoIdentityProvider
listener
- the new listener to be registeredpublic void identityChanged(java.lang.String newIdentityId)
identityChanged
in interface AWSCognitoIdentityProvider
newIdentityId
- the identityId to be savedprotected void appendUserAgent(AmazonWebServiceRequest request, java.lang.String userAgent)
request
- the request object to be appendeduserAgent
- additional user agent string to appendpublic void clearListeners()
AWSCognitoIdentityProvider
clearListeners
in interface AWSCognitoIdentityProvider
protected java.lang.String getUserAgent()
protected void update(java.lang.String identityId, java.lang.String token)
identityId
- the new identityId to be used for the usertoken
- the new token to be used with STSpublic java.lang.String refresh()
AWSIdentityProvider
refresh
in interface AWSIdentityProvider