{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-amplify/issues/505","repository_url":"https://api.github.com/repos/aws/aws-amplify","labels_url":"https://api.github.com/repos/aws/aws-amplify/issues/505/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-amplify/issues/505/comments","events_url":"https://api.github.com/repos/aws/aws-amplify/issues/505/events","html_url":"https://github.com/aws/aws-amplify/issues/505","id":307914540,"number":505,"title":"Configure cognito refresh token expiration time","user":{"login":"dagda1","id":118328,"avatar_url":"https://avatars0.githubusercontent.com/u/118328?v=4","gravatar_id":"","url":"https://api.github.com/users/dagda1","html_url":"https://github.com/dagda1","followers_url":"https://api.github.com/users/dagda1/followers","following_url":"https://api.github.com/users/dagda1/following{/other_user}","gists_url":"https://api.github.com/users/dagda1/gists{/gist_id}","starred_url":"https://api.github.com/users/dagda1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagda1/subscriptions","organizations_url":"https://api.github.com/users/dagda1/orgs","repos_url":"https://api.github.com/users/dagda1/repos","events_url":"https://api.github.com/users/dagda1/events{/privacy}","received_events_url":"https://api.github.com/users/dagda1/received_events","type":"User","site_admin":false},"labels":[{"id":845261099,"url":"https://api.github.com/repos/aws/aws-amplify/labels/Auth","name":"Auth","color":"bfdadc","default":false},{"id":708993532,"url":"https://api.github.com/repos/aws/aws-amplify/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-23T06:18:55Z","updated_at":"2018-04-12T13:00:17Z","closed_at":"2018-03-25T16:33:47Z","author_association":"NONE","body":"In my app, I make a call to getSession if the user refreshes the page or tries to access a client side rout that requires the user to be authenticated.\r\n\r\nThe problem I am seeing is that the refreshToken never expires.\r\n\r\nSo I do this:\r\n```\r\nconst currentSession = await authorisationProvider.getSession();\r\n\r\nthis.setState({ isAuthenticated: currentSession && currentSession.isValid(), busy: false });\r\n```\r\n\r\nBut having stepped through the code and if the cachedSession.isValid() call returns false then a call is made to refreshToken which always appears to return new tokens no matter how long I leave it.\r\n\r\nDoes the refreshToken never expire or can I configure it to expire in an hour or so?\r\n\r\nThe only way for things to expire is for localStorage.clear() to be called which is obviously not a real solution."},"comment":{"url":"https://api.github.com/repos/aws/aws-amplify/issues/comments/380796476","html_url":"https://github.com/aws/aws-amplify/issues/505#issuecomment-380796476","issue_url":"https://api.github.com/repos/aws/aws-amplify/issues/505","id":380796476,"user":{"login":"rdingwell","id":17702,"avatar_url":"https://avatars2.githubusercontent.com/u/17702?v=4","gravatar_id":"","url":"https://api.github.com/users/rdingwell","html_url":"https://github.com/rdingwell","followers_url":"https://api.github.com/users/rdingwell/followers","following_url":"https://api.github.com/users/rdingwell/following{/other_user}","gists_url":"https://api.github.com/users/rdingwell/gists{/gist_id}","starred_url":"https://api.github.com/users/rdingwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdingwell/subscriptions","organizations_url":"https://api.github.com/users/rdingwell/orgs","repos_url":"https://api.github.com/users/rdingwell/repos","events_url":"https://api.github.com/users/rdingwell/events{/privacy}","received_events_url":"https://api.github.com/users/rdingwell/received_events","type":"User","site_admin":false},"created_at":"2018-04-12T13:00:17Z","updated_at":"2018-04-12T13:00:17Z","author_association":"NONE","body":"I know this issue is closed but I figured it would be useful to answer this question in the context of the original question here.  \r\n\r\nHow do you set the refreshToken expiration period?  I have not seen how to do this in the documentation or in the AWS Management consoles for either Cognito or my MobileHub app.  \r\n\r\nIf it needs to be done in code is there an example available? \r\n\r\nThanks \r\n"}}
{"actor":{"display_login":"rdingwell"}}