admin管理员组文章数量:1023025
When successfully logged in into the cognito user pool, I can retrieve access token and id token from the callback function as
onSuccess: function (result) {
var accesstoken = result.getAccessToken().getJwtToken()
var idToken = result.idToken.jwtToken
}
But how can I retrieve the refresh token? And how can I get a new token using this refresh token. I didnot find any clear answers.
When successfully logged in into the cognito user pool, I can retrieve access token and id token from the callback function as
onSuccess: function (result) {
var accesstoken = result.getAccessToken().getJwtToken()
var idToken = result.idToken.jwtToken
}
But how can I retrieve the refresh token? And how can I get a new token using this refresh token. I didnot find any clear answers.
Share Improve this question asked May 4, 2018 at 16:07 Manoj AcharyaManoj Acharya 1,4792 gold badges17 silver badges28 bronze badges1 Answer
Reset to default 4You can use result.getRefreshToken().getToken()
for that.
The success callback takes CognitoUserSession
object i.e. result
as a parameter which exposes getRefreshToken
method to retrieve refresh token.
Refer this link for Cognito JavaScript SDK documentation -
https://github./aws/aws-amplify/tree/master/packages/amazon-cognito-identity-js
Not sure if I clearly understand your second question, but Use case 32 in above link might help you in dealing with it.
When successfully logged in into the cognito user pool, I can retrieve access token and id token from the callback function as
onSuccess: function (result) {
var accesstoken = result.getAccessToken().getJwtToken()
var idToken = result.idToken.jwtToken
}
But how can I retrieve the refresh token? And how can I get a new token using this refresh token. I didnot find any clear answers.
When successfully logged in into the cognito user pool, I can retrieve access token and id token from the callback function as
onSuccess: function (result) {
var accesstoken = result.getAccessToken().getJwtToken()
var idToken = result.idToken.jwtToken
}
But how can I retrieve the refresh token? And how can I get a new token using this refresh token. I didnot find any clear answers.
Share Improve this question asked May 4, 2018 at 16:07 Manoj AcharyaManoj Acharya 1,4792 gold badges17 silver badges28 bronze badges1 Answer
Reset to default 4You can use result.getRefreshToken().getToken()
for that.
The success callback takes CognitoUserSession
object i.e. result
as a parameter which exposes getRefreshToken
method to retrieve refresh token.
Refer this link for Cognito JavaScript SDK documentation -
https://github./aws/aws-amplify/tree/master/packages/amazon-cognito-identity-js
Not sure if I clearly understand your second question, but Use case 32 in above link might help you in dealing with it.
本文标签: Using Amazon Cognito Refresh Token to get new token in javascriptStack Overflow
版权声明:本文标题:Using Amazon Cognito Refresh Token to get new token in javascript - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745587287a2157675.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论