Which Category is your question related to?
React-Native Amplify Auth
What AWS Services are you utilizing?
Amplify and AppSync
Provide additional details e.g. code snippets
federatedInfo is deleted from Storage after failure to refresh provider token due to network error.
Without credentials it's impossible to make AWS requests even after getting a new token.
User has to logout or restart app to get new credentials
Log
[DEBUG] 43:45.240 Credentials - refresh federated token failed Failed to sign in with Google
[DEBUG] 43:45.246 AsyncStorageCache - Remove item: key is federatedInfo
[DEBUG] 43:45.251 AWSPinpointProvider - ensure credentials error refreshing federation token failed: Failed to sign in with Google
[DEBUG] 43:45.255 AWSPinpointProvider - cannot send events without credentials, applicationId or region
Hi @usmansbk
This seems like a bug, and I am labeling it as such.
Seems to me that the _refreshHandlers should support some form of retry strategies to make the more resilient to network errors
@manueliglesias is there any benefit of clearing the cache on failure to refresh?
}).catch(e => {
logger.debug('refresh federated token failed', e);
this.clear();
return Promise.reject('refreshing federation token failed: ' + e);
});
@manueliglesias is there any benefit of clearing the cache on failure to refresh?
I think it only makes sense when the refresh is unsuccessful due to an expired refresh token.
Most helpful comment
I think it only makes sense when the refresh is unsuccessful due to an expired refresh token.