-
Notifications
You must be signed in to change notification settings - Fork 72
Support Cumulocity IoT basic device registration to allow SmartREST 1.0 usage for older clients #3036
Description
Is your feature request related to a problem? Please describe.
Support Cumulocity IoT basic auth registration process to provide an upgrade path for existing customers whom use (legacy) SmartREST 1.0 (which is not supported when using cert based authentication)
Background
Existing customers with existing agents would like to take advantage of thin-edge.io and slowing migrate custom components. However these agents sometimes use SmartREST 1.0 which is incompatible with the cert-based device credentials (the default authentication used by thin-edge.io).
Describe the solution you'd like
Add support for basic auth device credentials for the Cumulocity IoT mapper so that devices can be registered following the Device Registration mechanism.
Implementation details
When using basic auth device credentials
- Do not store Cumulocity device credentials in the tedge.toml as these should be protected like a certificate (and not mixed with other non-sensitive configuration)
- c8y proxy must use a Basic Auth ,e.g.
Authorization: Basic <base64(username:password)> - Don't subscribe to
s/uatands/dattopics as they are only supported when using cert-based device credentials and errors will be posted tos/eif they are subscribed to
Open questions
- How to test an MQTT connection as the JWT topics are not available - Should a very basic SmartREST 1.0 template be used instead?
Implementation plan
The feature implementation can be broken into the following parts:
- Support new configuration sets the registration mode (e.g. use basic auth, or device credentials/jwt)
- Activate the basic mode via
tedge config set c8y.registration_mode "basic" - Allow a username and password to be set via the command line and store in a new file (owned by
tedgeand with600permissions)
- Activate the basic mode via
- Update components to support using either Bearer or Basic auth for communication with Cumulocity IoT REST API (see below for a list of components)
- Support registration of SmartREST 1.0 templates via a new tedge config
tedge config set c8y.smartrest1.templates "template1,template2" - Support the Cumulocity IoT device registration process using the Cumulocity IoT bootstrap credentials when calling
tedge connectand the "basic" registration mode is active (there are some UX aspects here to consider).
Describe alternatives you've considered
Additional context
Check list for components that require an update of the Authorization header mechanisms:
- Cumulocity IoT proxy (e.g. the
127.0.0.1:8001/c8yservice) - c8y-remote-access-plugin supports basic auth
- tedge-mapper
- bridges support both bearer and basic auth
- mosquitto bridge
- built-in bridge