AWS.config.credentials是页面请求之间空页面、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 c...

我使用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

阅读全文

相关推荐

最新文章