ProtoMed Device
Abstract
This document describes QRCode scanning to authorize an MSO subscriber (in this case, onboarding a medical device onto the subscriber’s WiFi network.)
Application
Source code for this application is in the micronets-idora-client
repository. It is a multi-platform mobile application written using the Cordova framework.
Required Servers
The following servers are required to setup an IdOra account and link it to an MSO’s Micronets applications - micronets-auth-server - micronets-idora-server
Note: When these servers (docker containers) are pulled and started, there should be a grandma/grandma account already created that is pre-authorized for MSO login via QRCode scanning.
Basic Operation
Account Creation
If necessary, a subscriber creates an IdOra account on the Idora Website (https://mycable.co/idora) This is a little buggy/quirky, UI-wise, follow closely. The main issue is that the browser keeps autofilling fields. - Open Browser Window, navigate to https://mycable.co/idora - Click LOG-IN - Ensure Username and Password fields are cleared - Click Sign Up - Signup screen appears. Enter a Username, Password, Email - Click Sign Up again. - Now the login returns, probably with the wrong autofill data. Change username/password to the correct values - Click Login - Now you are redirected to the manage websites screen. - Click the micronets box to enable it - You are redirected to the authorization server login screen to enable the QRCode scanning for this MSO. - NOTE: This username/password HAS TO MATCH THE MSO credentials, not necessarily the IdOra Credentials. For this demo, we use grandma/grandma for both the IdOra and MSO credentials. Deviate at your own risk. MSO credentials are hard coded in the authorization server:
const userInfo = {
"alice": {
"sub": "9XE3-JI34-00132A",
"username": "alice",
"password": "secret"
},
"bob": {
"sub": "1ZT5-OE63-57383B",
"username": "bob",
"password": "pass"
},
"grandma": {
"sub": "7B2A-BE88-08817Z",
"username": "grandma",
"password": "grandma"
}
};
Using the iOS/Android QRCode Scanner application
If you are starting the application cold, you will need to log in. If resuming from standby AND the IdOra Server has not been restarted, you won’t need to (session should still be active).
If you do need to log in, there is an annoying bug. When you click the Login button (after filling in user/pass), the virtual keyboard disappears, but the Login screen is still showing. You have to click the Login button again. TODO: Fix this. Once you are logged in, you can click the SCAN QR CODE button and scan the code presented by the MSO authorization server. screen. This should initiate the pairing process.
Troubleshooting
- Re-deploy the servers. On the Registration (mycable.co) instance, run
/etc/micronets/docker-update all
- This will pull fresh containers, which will have database files pre-initialized with a pre-authorized grandma
- Restart the iOS application, log in again.
- Cable the iPhone to your Mac, run Safari (Developer tools installed) and use the web inspector to debug
- Nuclear Option
- Open a bash terminal in both the micronets-auth-server and micronets-idora-server containers
- Delete the .nedb files
- Restart both containers
- Recreate the grandma account on the Idora website
- If all else fails, just click on the QRCode to get through the demo :(
Changing the URL of the registration server
- In the iOS app, click the menu icon -> Settings -> Server Address. Default is
https://mycable.co/idora
. - Unfortunately, this is not persisted (baked into the application). On application restart, you’ll have to change it again. It is best to just change the default server URL in the application and redeploy (www/index.html).
- Fortunately, it is super simple to change in the source code (index.html) and redeploy. Look at the README in the micronets-idora-client repository