-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: allow custom client id, different from thing name #424
Comments
Hello @antoine-sac , sorry for the delayed response. I am not sure if it is a good idea to change the ClientId default from thing name to something else. Mainly because the topic to which device client subscribe to is derived from the thing name. Example: To get notification of the next job in the queue which device subscribes to We can make a change to also allow passing thing-name separately so that we still subscribe to all feature required topics correctly. Will that be acceptable to you? Regards, |
Hello Harsh, You raise a very good point, indeed it'll be necessary to pass the thing-name too. Alternatively, what I personally do in my code is pass a thing name and a client id suffix, then I construct the client ID as the thing name + suffix. It's worth noting that it can be quite complicated to craft the appropriate device policy when you want to use the thing name in a topic filter, because AWS seems to derive the thing name from the client id when evaluating permissions... The only way I managed to get restricted permissions to work is to actually create a second thing, using the same certificate. This way, each client has its own thing name. |
Hey @antoine-sac , I am still working with our team to understand if there will be any difficulty/complications having I have a question regarding your other client: Device Client also has Shadow feature along with Jobs and Secure Tunneling. What is stopping you from using Device Clients Shadow feature? |
Hello @antoine-sac , I spoke with our team and found out that the thing policy restricts devices with different thing-name and client-id from making multiple connections to IoT core at the same time. Also as you have mentioned earlier, it can be quite complicated to craft the appropriate device policy so for now we cannot work on this feature request for device client. I think you have two options right now,
Also it would help us to know what is stopping you from using device client's shadow feature. If you are able to use it, this problem will go away. Regards, |
Hello @HarshGandhi-AWS, I have come to the same conclusion: it's impossible to use a client-id different from the thing-name with a production-level device policy. We'll stick to our current approach of provisioning 2 things for the 2 clients Regarding why we don't use the device client for everything, indeed the sensor publish feature and the shadow feature would cover our 2 use cases for using our own client. We don't use them because:
Example of basic info we'd need before considering using the shadow feature in production:
It's actually much easier to implement our own shadow service using the shadow MQTT topics because those are extremely well documented.
Lastly, I just want to say that despite the limitations above, we find the AWS IoT Device Client extremely useful and we're grateful that you're maintaining it. It's proven invaluable as a safeguard to allow us to send jobs and open secure tunnels to our devices when we trouble with our own services. You sound like you may be the equivalent of a product owner and there's always insight in feedback which is why I listed all the above. Cheers |
Hello @antoine-sac , thank you for your feedback. Device Client was built as a sample implementation of client which will run on the device to connect with IoT core and use different IoT functionalities. This software was not intended to run on production device; we expect users to make a clone/fork of this repository and build their own version of the client suitable to their usecase. Building your own version of client should not be difficult if you use Device Client as a base. Regarding segmentation faults and documentation, feel free to open a ticket and team will look through it and try to resolve it as soon as possible. Also if you have found the problem and know the fix, we encourage you to make an update via pull request and team will be more than happy to review and merge it. This software is built for the IoT community. Regards, |
Feature Request:
I sometimes run the AWS IoT Device Client alongside other software using another MQTT client. Typically, the AWS IoT Device Client takes care of jobs and secure tunnelling while other bits of software use device shadows directly with their own MQTT client.
This leads me to a situation where I can have 2 MQTT clients for the same thing, which means I need 2 different client ids. Currently I cannot choose the client ID used by the AWS IoT Device client: it is always the thing name (which is a good default).
I would like to be able to change the client ID independently from the thing name, which could be achieved with an optional
CLIENT_ID
env var, an optional--client-id
flag, etc.For example,
--client-id ${thing_name}-aws-iot
(assuming that the cert policy allows this name).The default behaviour should of course still be to use the thing name as client id as it is a very sensible default.
The text was updated successfully, but these errors were encountered: