Documentation says: "The tokens are automatically refreshed by the library when necessary.". I call
AWSMobileClient.getInstance().getTokens().getAccessToken().getTokenString();
everytime before calling the API with AccessToken.
Here is what my awsconfiguration file looks like
`{
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "ap-xxxxx-1:2xxxxxx-xxxx-xxxx-xxxx-7xxxxxxxxxx",
"Region": "ap-xxxxx-1"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "ap-xxxxx-1_xxxxxxxxx",
"AppClientId": "xxxxxxxxxxxxxxxxxxxxx",
"Region": "ap-xxxxx-1"
}
}
After an hour, API returns 401(Authentication Error).
And AWSMobileClient.getInstance().getTokens().getAccessToken().getTokenString();
returns an error
AWSMobileClient: Tokens are invalid, please sign-in again.
java.lang.Exception: No cached session.
Am I doing something wrong? PS: I have not used Amplify CLI.