By using AWS re:Post, you agree to the AWS re:Post Terms of Use

MissingAuthenticationTokenException

0

Hi,

I'm developing a project of segurity camera, the camera firmware sends the data in base64 from the camera through an MQTT message, a lambda function in javascript and node js receives the data and processes it to start a live stream in kinesis video stream.

I'm using http2 to send it to KVS but I have an error that I can't solve.

{ 'x-amzn-errortype': 'MissingAuthenticationTokenException: ......', }

What does this error message mean and how could I solve it?

Thank you.

Oliver B.

2 Answers
0

The "MissingAuthenticationTokenException" error you're encountering occurs because the HTTP/2 connection to Kinesis Video Streams (KVS) requires proper AWS authentication credentials. It can be a common issue when setting up video streaming with KVS. To solve this issues, I would recommend the following:

  1. Include AWS Credentials
  • Your requests to KVS must include valid AWS credentials
  • These credentials authenticate your service to access KVS resources
  1. Implement Request Signing
  • All requests must be signed using AWS Signature Version 4 (SigV4)
  • This signing process ensures request authenticity and integrity
  1. Configure IAM Permissions The Lambda function's execution role needs specific permissions:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kinesisvideo:PutMedia",
                "kinesisvideo:GetDataEndpoint"
            ],
            "Resource": "*"
        }
    ]
}
AWS
answered 10 days ago
  • Thanks for answering, I'll try it

0

Hi,

All AWS services require all client requests to be signed with SigV4 protocol: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html (Plain http won't work)

It is a quite sophisticated protocol: getting it right takes time (I tried ...).

So, it is much simpler to use the AWS SDK of your language to directly leverage its SigV4 implementation.

Since the AWS SDK is OSS and if you really need to implement SigV4 youself, I recommend to get the corresponding SigV4 implementation from our SDK of choice. (That's what I ended up doing...)

Best,

Didier

profile pictureAWS
EXPERT
answered 10 days ago
  • Thanks for answering,

    I'm really new to this, do you know a place where I can see an example of how it is implemented?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions