My organization was formerly using @aws-sdk/client-rekognition version 3.231.0, but in an aid to use the Faceliveness features we had to update to version 3.606.0, All the older features
CompareFacesCommand,
CreateCollectionCommand,
IndexFacesCommand,
SearchFacesByImageCommand,
DetectFacesCommand,
DeleteCollectionCommand,
ListCollectionsCommand,
DetectModerationLabelsCommand,
and Attribute,
work perfectly without any problems, but each time I attempt to make a CreateFaceLivenessSessionCommand request, I get the error
AccessDeniedException: UnknownError
at de_AccessDeniedExceptionRes (/home/thegodtune/src/pepster/backend/node_modules/@aws-sdk/client-rekognition/dist-cjs/index.js:2644:21)
at de_CommandError (/home/thegodtune/src/pepster/backend/node_modules/@aws-sdk/client-rekognition/dist-cjs/index.js:2565:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /home/thegodtune/src/pepster/backend/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20
at async /home/thegodtune/src/pepster/backend/node_modules/@smithy/core/dist-cjs/index.js:165:18
at async /home/thegodtune/src/pepster/backend/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38
at async /home/thegodtune/src/pepster/backend/node_modules/@aws-sdk/client-rekognition/node_modules/@aws-sdk/middleware-logger/dist
cjs/index.js:34:22 {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: '92d62824-31f2-4dae-9812-5aa6c5e25639',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Code: undefined,
Logref: undefined,
__type: 'AccessDeniedException'
}
I have verified that the user associated with the key ID and secret access key used for the request has all admin-level permission policies, including AmazonRekognitionFullAccess. But this error persists. I followed the instructions provided {https://docs.aws.amazon.com/rekognition/latest/dg/face-liveness-calling-apis.html} and {https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateFaceLivenessSession.html}.
This is the code
const client = new RekognitionClient({ region: "eu-west-2" });
export const rekognitionCreateFaceLivenessSession = async (id: string) => {
try {
const input = {
ClientRequestToken: id,
};
const session = await client.send(
new CreateFaceLivenessSessionCommand(input)
);
return session;
} catch (error: any) {
console.error(`Error details: ${JSON.stringify(error)}`);
throw error;
}
};