admin管理员组文章数量:1287584
I'm running into some problems when I attempt to refresh my session tokens, (Access, Id, Refresh). I have already read this question and the answer has helped me understand what is going on some. But I feel what I am trying to do isn't quite what getSession
is for.
I am attempting to implement a session expiration message (done) that allows the user to extend their session (refreshes the tokens). From what I gather about getSession()
, it returns either the old tokens, if they are still valid, or new tokens if they are not valid. Please correct me if I am wrong there.
I am attempting to give the user new/refreshed tokens every time they click on extend session. For dev purposes, I have a button which then displays the message with the extend session button. The tokens I receive when I call getSession()
are the old ones, but I want them to be new ones.
So basically, nullifying the old session and giving them a new one.
My questions are:
- Am I missing some understanding about
getSession()
, as previously mentioned? - Can I give the user new session tokens (Access, Id, Refresh)?
- Can I do #2 without having the user sign in again?
Thank you.
EDIT 1: It may help to know that I am not using any Federated Identities.
I'm running into some problems when I attempt to refresh my session tokens, (Access, Id, Refresh). I have already read this question and the answer has helped me understand what is going on some. But I feel what I am trying to do isn't quite what getSession
is for.
I am attempting to implement a session expiration message (done) that allows the user to extend their session (refreshes the tokens). From what I gather about getSession()
, it returns either the old tokens, if they are still valid, or new tokens if they are not valid. Please correct me if I am wrong there.
I am attempting to give the user new/refreshed tokens every time they click on extend session. For dev purposes, I have a button which then displays the message with the extend session button. The tokens I receive when I call getSession()
are the old ones, but I want them to be new ones.
So basically, nullifying the old session and giving them a new one.
My questions are:
- Am I missing some understanding about
getSession()
, as previously mentioned? - Can I give the user new session tokens (Access, Id, Refresh)?
- Can I do #2 without having the user sign in again?
Thank you.
EDIT 1: It may help to know that I am not using any Federated Identities.
Share Improve this question edited May 23, 2017 at 12:09 CommunityBot 11 silver badge asked Jan 9, 2017 at 20:42 Hypnic JerkHypnic Jerk 1,1923 gold badges14 silver badges32 bronze badges1 Answer
Reset to default 9You can call cognitoUser.refreshSession. I've found a reasonable example for you over here:
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
Look for the method called checkTokenExpiration, it explains perfectly well what you have to do to refresh the session.
本文标签: javascriptAWS Cognito force refresh sessionStack Overflow
版权声明:本文标题:javascript - AWS Cognito force refresh session - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741279580a2369929.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论