Closed rococtz closed 6 years ago
Hi @rococtz , You are right that using cert and root CA in browser environment is not recommended. Instead, you can use websocket connection which only requires IAM credentials. https://github.com/aws/aws-iot-device-sdk-js#connections
Thank you for the info @fengsongAWS , but I still can't get it to work. I created a custom authorizer in my AWS IoT console and then I instantiate the client like this:
client = awsIot.device({
protocol: 'wss-custom-auth',
host: 'my-host.us-east-2.amazonaws.com',
customAuthHeaders: {
'X-Amz-CustomAuthorizer-Name': '<name-of-mycustom-authorizer-in-aws-iot>',
'X-Amz-CustomAuthorizer-Signature': '< ???? >',
'<token-key-name-I-created>': '<some-generated-token>'
}
});
Any idea what goes into X-Amz-CustomAuthorizer-Signature
?
Hi @rococtz , That filed is used for customer who wants to use custom auth feature. If you do not want to set up custom auth, you can simply ignore that. For your web browser, you can setup coginito and websocket connection using IAM credentials.
Please open another thread if you still have questions.
I am trying to setup a simple device client in the browser following this example in the README file:
I have created a thing, a type and associated them with a police in my AWS IoT console, but where do I get the <...> information from? Also, since it's going to be part of a front-end application, is it safe to put it here?