Closed 6293 closed 3 years ago
will update README after holidays
Hi @z8674558,
I tried your branch. In general both authentication methods (user +pw & certificates) should be supported. Unfortunately your changes broke the user + pw bootstrapping authentication. Most likely because you added dummy config entries for externalId, tenant, user and password in the agent.ini. If I remove them bootstrapping is working again.
Any way how this can be improved that both modes can run in parallel e.g. detect if ENV variables are set overwrite the whole config entries otherwise use config file values.
thank you @switschel, I was not aware of it.
Now the override is done by modifying agent.ini when the creation of Configuration
object, instead of modifying interpolation logic. This enables you to override values even if agent.ini does not have a corresponding category/key yet.
It looks like I don't have a permission to accept device bootstrapping in my tenant, so please check if bootstrapping is working fine (I have checked that a device can connect to bootstrapping tenant though).
On start with ./start.sh without setting the env variables I get this
scripts/start_docker.sh: line 8: C8YDM_MQTT_CERT_AUTH: unbound variable
I think this can be avoided by using
if [ -n "${C8YDM_MQTT_CERT_AUTH:-}"
Thank you for the support. will add test modules
https://github.com/SoftwareAG/cumulocity-devicemanagement-agent/issues/25#issuecomment-915094898
Basically this change will help you start docker container (
start.sh
) with config modified for given tenant:By executing this, certificates will be generated and the root ca is uploaded to your tenant, then the agent will connect to the tenant with cert authentication.