openhab-cloud icon indicating copy to clipboard operation
openhab-cloud copied to clipboard

Show QR code with url, username and password

Open mueller-ma opened this issue 7 years ago • 5 comments

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

mueller-ma avatar Apr 06 '18 20:04 mueller-ma

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 :)

FlorianSW avatar Apr 19 '18 18:04 FlorianSW

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.

mueller-ma avatar Apr 20 '18 10:04 mueller-ma

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 :)

FlorianSW avatar Apr 22 '18 11:04 FlorianSW

Do you think it would be useful to add parameters to the qr code to configure everything in the app, e.g. icon format?

mueller-ma avatar May 06 '18 18:05 mueller-ma

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 :)

FlorianSW avatar May 10 '18 21:05 FlorianSW