amazon-archives/amazon-transcribe-websocket-static

Handling credentials

ceuk opened this issue · 2 comments

ceuk commented

Hi,

In order to prevent hardcoding keys into public code (as in the example), I'm trying to leverage unauthenticated Cognito sessions in a similar fashion to how you might do it for Polly and I've attached the appropriate policy to the unauthed IAM role. However, using the access key and secret from the credentials object gives me a The security token included in the request is invalid. error (despite it working for Polly)

Am I doing something wrong?

Hi @calvin-evans, the SDK has a lot of tooling behind the credential providers and the AWS config object that I think is sending additional date to Polly as part of the pre-signed URLs that this demo currently doesn't send. I would suggest capturing the initial HTTP handshakes for Polly and Transcribe and comparing the payloads to see if there's any obvious differences

ceuk commented

Solved it - looks like it was the X-Amz-Security-Token header.

Will submit a quick a PR to correct this and #1