aws-samples / aws-samples/aws-amplify-react-iot-pub-sub-using-cp
bug: policy in aws-iotcore-configuration.js should allow connection from "mqtt-explorer-" as well
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Two ClientIds are used in the MQTTDisplay.js. Therefore, both of them should be allowed to connect from the IoT policy defined in aws-iotcore-configuration.js. The subscription doesn't work since only the clienId prefix - iotcognito-cp-sampleapp- - is allowed.
- iotcognito-cp-sampleapp-
- mqtt-explorer-
```
var awsIotCoreConfiguration = {
endpoint: ''',
region: '',
apiVersion: '2015-05-28',
policy: '{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Action": [ "iot:Subscribe" ], "Resource": ["arn:aws:iot:::topicfilter/*"]},{"Effect": "Allow","Action": [ "iot:Connect" ],"Resource": ["arn:aws:iot:::client/iotcognito-cp-sampleapp-*"] },{"Effect": "Allow","Action": [ "iot:Connect" ],"Resource": ["arn:aws:iot:::client/mqtt-explorer-*"] },{"Effect": "Allow","Action": [ "iot:Publish","iot:Receive" ],"Resource": ["arn:aws:iot:::topic/*"]}]}'
};
export default awsIotCoreConfiguration;
```
Contributor guide
Assessment
This issue has not been assessed yet.