das*_*mug 9 amazon-web-services amazon-cognito aws-amplify
在AWS Amplify的存储文档中,有一节介绍如何获取其他用户的对象......
Storage.get('test.txt', {
level: 'protected',
identityId: 'xxxxxxx' // the identityId of that user
})
Run Code Online (Sandbox Code Playgroud)
在哪里可以获取其他用户的identityId?
我只能查询用户的 Cognito 用户池 ID。有没有办法将用户池 ID 映射到身份 ID?
小智 10
您可以使用 Auth.currentUserCredential 方法获取身份 ID
import { Auth } from 'aws-amplify';
await Auth.signIn(username, password);
const credentials = await Auth.currentUserCredentials();
console.log("identityId", credentials.identityId);
Run Code Online (Sandbox Code Playgroud)
经过大量研究并研究了一些类似/相关的问题/答案,AWS 似乎仍然缺少这一点。
我发现的最接近的主题来自 AWS 论坛:https://forums.aws.amazon.com/thread.jspa? messageID=924345,该主题仍未得到答复:-)
| 归档时间: |
|
| 查看次数: |
7115 次 |
| 最近记录: |