nodejs-api-server

1.0.0 • Public • Published

Auth

Onboarding Api with OAuth and physical button

How to start it from target GW

  1. First you need to locate the IP of your gateway using either your router or scan using avahi-browse

    #> avahi-browse -ar | grep gw2-.* -A3

    This will list all mDNS records that have gw2- Look for the ipv4.

  2. Transfer the code to target GW

    First check that you can access the gateway with ssh. #> ssh root@

    There is no password set for root.

    #> cd <onboarding_poc_git> #> scp -r nodeJS root@:/usr/local/

  3. Now all files in the folder nodeJS are located on the gateway filesystem under /usr/local/nodeJS

  4. Start the server #> ssh root@ root@gw2-0ac3d654c2b4:# cd /usr/local/nodeJS root@gw2-0ac3d654c2b4:# npm install root@gw2-0ac3d654c2b4:~# npm start

Test server using postman

  1. Install postman on the host and start it

  2. Then create a GET request with this link:

    http://:3000/oauth/authorize?audience=homesmart.local&response_type=code&code_challenge=O7MvFG4EiHPxwqkK8P1gXtHs7WRAahzsgBMmgNMbwLk&code_challenge_method=S256

  3. Send it and check the return payload. It Should look like this:

    { "auth_code": "" }

/nodejs-api-server/

    Package Sidebar

    Install

    npm i nodejs-api-server

    Weekly Downloads

    0

    Version

    1.0.0

    License

    none

    Unpacked Size

    46.3 kB

    Total Files

    21

    Last publish

    Collaborators

    • di98ese