I am following this tutorial for connecting Raspberry Pi to AWS IoT using Node.js SDK. I see the following in vim ~/.aws/credentials

[default]
aws_access_key_id = SOMETHING
aws_secret_access_key = SOMETHINGELSE

When I enter the command aws iot describe-endpoint I get the following response:

{
    "endpointAddress": "A34SXNTM6AT7XH.iot.us-west-2.amazonaws.com"
}

However when I browse to that URL: https://a34sxntm6at7xh.iot.us-west-2.amazonaws.com/ I get the following error:

Missing Authentication Token

enter image description here

Any idea what could be wrong and how could it be solved?

enter image description here

enter image description here

Here's the files in the ~/certs folder:

pi@raspberrypi:~/certs $ ls
certificate.pem.crt  private.pem.key  public.pem.key  root-CA.pem
share|improve this question
up vote 2 down vote accepted

Mona,

Your custom endpoint responds to two protocols: MQTT and HTTPS. However, it does not serve any web content and thus does not work in the browser as a site URL. The "endpointAddress" you get from aws iot describe-endpoint will be plugged into your Node.js Device SDK that you're using in the Raspberry Pi example you linked (no https://).

You can also interface with device shadows using the HTTPS version of the endpoint by signing requests with AWS Signature version 4. More on that here: http://docs.aws.amazon.com/iot/latest/developerguide/thing-shadow-rest-api.html and here: http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html though you will likely get going faster by using the AWS CLI or AWS SDK to perform operations like this.

Ryan @ AWS

share|improve this answer
3  
Nice to see the ticket can be answered from AWS staff directly. – BMW Mar 6 '16 at 22:34
    
Hi Ryan, so does it mean considering the fact I have done all the steps in the tutorial successfully, this "missing authentication token" should be neglected? – Mona Jalal Mar 6 '16 at 22:58
    
Also in the file cmdline.js does it know by default to look at ~/certs ? default: { region: 'us-west-2', protocol: 'mqtts', clientId: clientIdDefault, privateKey: 'private.pem.key', clientCert: 'certificate.pem.crt', caCert: 'root-CA.crt', – Mona Jalal Mar 6 '16 at 23:05
    
@Ryan: with regards to my second question, according to page 117 of docs.aws.amazon.com/iot/latest/developerguide/iot-dg.pdf examples assume that certificates are in ~/certs directory so I was correct on that! – Mona Jalal Mar 6 '16 at 23:12
    
Additionally can you please have a look at here stackoverflow.com/questions/35834075/… – Mona Jalal Mar 6 '16 at 23:50

By default, the example programs will look in the current directory for your certificate and private key files, but you can also use the '-f' option to specify another directory if you want to. As for the 'Missing Authentication Token' message you noticed when trying to access the endpoint from your browser, you can safely ignore it.

share|improve this answer

If you use "TLS mutual authentication" you need to connect on port 8443, so in your example, it would be https://a34sxntm6at7xh.iot.us-west-2.amazonaws.com:8443/things/<thing_name>/shadow

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.