Show QR code with url, username and password
A user wants to be able to scan a QR code provided in openhab cloud to configure a client: https://github.com/openhab/openhab-android/issues/721
How would the format look like? Generating a QR code should be fairly easy. However, we're not saving the user's password in plain text (and that's correct in that way :P), so the user would still need to enter their password manually :)
The QR code can represent a string, e.g. url=https://myopenhab.org&[email protected]&pw=1234.
The password can be entered by the user in a password field that is only used to generate the qr clientside via js and the password is thrown away afterwards. I would still prefer this over having to type the password on my smartphone.
Ok, makes sense. We would need to add a note to the QR Code, that the code shouldn't be saved as it contains the password in plain text to be transferred to the device.
As a separator for the parts (url, username, password) we would need to find a usable one, especially because there're no blacklisted chars for the username so far, iirc (even if we say, that it must be a valid e-mail address).
@digitaldan Can you maybe look at the DB and check, if there's any username containing a & sign in it? If not, we could blacklist this one for registering a new account and use this as a separator :)
Do you think it would be useful to add parameters to the qr code to configure everything in the app, e.g. icon format?
I wouldn't add too much things that can be configured with the QR code. As a user I would expect the QR code to be used to "pair" my device with the currently logged in openHAB-cloud instance, so url, username and passwort should be enough.
If we take settings into the QR code the question would be: What settings would be included and what, if the user already changed one of these, are the values overwritten? I don't think, that this is something someone would expect at all in a QR code :)