gpt4 book ai didi

php - 我应该使用什么作为 Cognito 的 UserContextData => EncodedData?

转载 作者:行者123 更新时间:2023-12-04 21:29:00 26 4
gpt4 key购买 nike

在大多数功能的所有 AWS Cognito 开发工具包中,您可以传递 UserContextData用于提供 Cognito 高级安全功能的参数:

$result = $client->forgotPassword([
'AnalyticsMetadata' => [
'AnalyticsEndpointId' => '<string>',
],
'ClientId' => '<string>', // REQUIRED
'SecretHash' => '<string>',
'UserContextData' => [ // <=================== THIS
'EncodedData' => '<string>',
],
'Username' => '<string>', // REQUIRED
]);

此字段需要一些 EncodedData .

我应该放什么UserContextData以及如何“编码”它?

使用 Admin* 时函数如 AdminInitiateAuth我可以通过 ContextData 发送未编码的指纹数据:
$result = $client->adminInitiateAuth([
[...]
'ContextData' => [
'EncodedData' => '<string>',
'HttpHeaders' => [ // REQUIRED
[
'headerName' => '<string>',
'headerValue' => '<string>',
],
// ...
],
'IpAddress' => '<string>', // REQUIRED
'ServerName' => '<string>', // REQUIRED
'ServerPath' => '<string>', // REQUIRED
],
[...]
]);

documentation没有帮助:
enter image description here

最佳答案

AWS 提供了一个 opaque implementation用于用户上下文数据。
encodedData将在设备上而不是服务器上收集。

Cognito Javascript client SDK公开了实现此目的的方法。它在 Amplify Android SDK 中提供

您可以获得转账encodedData从客户端到服务器,然后在您的请求中将其转发到 Cognito。

关于php - 我应该使用什么作为 Cognito 的 UserContextData => EncodedData?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58186556/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com