In all AWS Cognito SDKs in most functions you can pass an UserContextData parameter to feed Cognito's Advanced Security feature:
$result = $client->forgotPassword([
'AnalyticsMetadata' => [
'AnalyticsEndpointId' => '<string>',
],
'ClientId' => '<string>', // REQUIRED
'SecretHash' => '<string>',
'UserContextData' => [ // <=================== THIS
'EncodedData' => '<string>',
],
'Username' => '<string>', // REQUIRED
]);
This field expects some EncodedData.
What should I put in UserContextData and how do I "encode" it?
When using an Admin* function like AdminInitiateAuth I can send unencoded fingerprinting data through ContextData:
$result = $client->adminInitiateAuth([
[...]
'ContextData' => [
'EncodedData' => '<string>',
'HttpHeaders' => [ // REQUIRED
[
'headerName' => '<string>',
'headerValue' => '<string>',
],
// ...
],
'IpAddress' => '<string>', // REQUIRED
'ServerName' => '<string>', // REQUIRED
'ServerPath' => '<string>', // REQUIRED
],
[...]
]);
The documentation does not help:
