I´m new to AWS cognito identity provider and I´m trying to workaround an issue where an app becomes "unresponsive" after one hour.
I´ve already tracked down the following exception:
Invalid login token. Token Expired xxx > yyy
That being said, I´m trying to use a refresh token to update my id/access tokens.
I´m trying to use the following method:
new AWS.CognitoIdentityServiceProvider({ apiVersion: '2016-04-18' }).adminInitiateAuth(params,cb)
where I´m sending the following as params:
{
"AuthFlow":"REFRESH_TOKEN_AUTH",
"ClientId":"xxx",
"UserPoolId":"ap-northeast-2_7wGKApTQV",
"AuthParameters":{
"REFRESH_TOKEN":"ommited, but valid",
"USERNAME":"luizhenrique.rolim@gmail.com"
}
}
However, I get the following error, along with a null AuthenticationResultType object
code:"CredentialsError"
message:"No credentials to load"
- Am I on the right path for refreshing the idtoken?
- Why is my call to adminInitiateAuth failing?
Thanks