AWS.config.credentials是页面请求之间空 [英] AWS.config.credentials are null between page requests

查看:560
本文介绍了AWS.config.credentials是页面请求之间空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Facebook的创建通过AWS Cognito经过验证的身份,这是所有工作正常,我可以登录,并同步数据。

I'm using Facebook to create an authenticated identity via AWS Cognito, that's all working fine and I can login, and synchronise data.

不过,如果我导航离开我的登录页面 - 但留在我的网站 - 底层AWS.config.credentials对象然后空,并通过不同的网页我无法同步任何数据。

However, if I navigate away from my sign-in page - but remain in my site - the underlying AWS.config.credentials object is then null and I can't synchronise any data via a different page.

可疑我缺少明显的东西,但不能从亚马逊的文档看到它,不知道是什么!

Suspect I'm missing something obvious but can't see it from the Amazon docs and don't know what!

编辑:对不起 - 应该增加 - 这是通过使用Javascript SDK

Sorry - should have added - this is via the Javascript SDK

推荐答案

只有身份ID保持页面之间,凭证都没有。您将需要缓存Facebook的令牌,并将其提供给凭据对象,当你的页面之间进行转换,以获得AWS凭据。您还需要跟踪Facebook的到期令牌,以便可以刷新缓存的标记,如果它已过期。该论坛的帖子对过程的更多细节。 https://forums.aws.amazon.com/thread.jspa ?主题ID = 179420&放大器; TSTART = 25

Only the identity id is maintained between pages, credentials are not. You will need to cache the Facebook token and supply it to the credentials object when you transition between pages to get AWS credentials. You will also need to track expiry of the Facebook token so can refresh your cached token if it has expired. This forums post has more details on the process. https://forums.aws.amazon.com/thread.jspa?threadID=179420&tstart=25

这篇关于AWS.config.credentials是页面请求之间空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆