Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 如何在通过AWS联合身份验证后获得访问令牌_Amazon Web Services_Amazon Cognito - Fatal编程技术网

Amazon web services 如何在通过AWS联合身份验证后获得访问令牌

Amazon web services 如何在通过AWS联合身份验证后获得访问令牌,amazon-web-services,amazon-cognito,Amazon Web Services,Amazon Cognito,我理解,当我们通过Cognito用户池进行身份验证时,我们可以获得访问令牌,如以下方法: cognitoUser.authenticateUser(authenticationDetails, { onSuccess: function (result) { console.log('access token + ' + result.getAccessToken().getJwtToken()) 现在,当我们使用Facebook、Goo

我理解,当我们通过Cognito用户池进行身份验证时,我们可以获得访问令牌,如以下方法:

cognitoUser.authenticateUser(authenticationDetails, {
            onSuccess: function (result) {
                console.log('access token + ' + result.getAccessToken().getJwtToken())

现在,当我们使用Facebook、Google等联合身份时,如何获得访问令牌?是否可以获取访问令牌?我可以看到Facebook令牌,但这与AWS用户池中的AWS令牌不同。

您还必须集成auth SDK,位于以下位置:


如果Facebook是你的用户池的身份提供者,你就可以登录Facebook。在用户池中创建相应的用户,auth SDK将该用户名和令牌保存在本地存储位置,该位置与包含authenticateUser方法的Cognito用户池SDK从中检索该用户名和令牌的位置相同。通过使用Cognito用户池SDK中的getCurrentUser和getSession,您可以检索该用户和包含令牌的会话。

您可以分享一个示例吗?