Skip to content

Commit

Permalink
Fix nightscout#5347 - Addressed auth roles
Browse files Browse the repository at this point in the history
  • Loading branch information
inventor96 committed Dec 31, 2019
1 parent 1fb5939 commit 40ae606
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/plugins/alexa-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Create a new Alexa skill](#create-a-new-alexa-skill)
- [Define the interaction model](#define-the-interaction-model)
- [Point your skill at your site](#point-your-skill-at-your-site)
- [Do you use Authentication Roles?](#do-you-use-authentication-roles)
- [Test your skill out with the test tool](#test-your-skill-out-with-the-test-tool)
- [What questions can you ask it?](#what-questions-can-you-ask-it)
- [Activate the skill on your Echo or other device](#activate-the-skill-on-your-echo-or-other-device)
Expand Down Expand Up @@ -75,10 +76,20 @@ Now you need to point your skill at *your* Nightscout site.
1. In the left-hand menu for your skill, there's an option called "Endpoint". Click it.
1. Under "Service Endpoint Type", select "HTTPS".
1. You only need to set up the Default Region. In the box that says "Enter URI...", put in `https://{yourdomain}/api/v1/alexa`. (So if your Nightscout site is at `mynightscoutsite.herokuapp.com`, you'll enter `https://mynightscoutsite.herokuapp.com/api/v1/alexa` in the box.)
- If you use Authentication Roles, you'll need to add a bit to the end of your URL. See [the section](#do-you-use-authentication-roles) below.
1. In the dropdown under the previous box, select "My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority".
1. Click the "Save Endpoints" button at the top.
1. You should see a success message pop up when the save succeeds.

### Do you use Authentication Roles? ###

If you use Authentication Roles, you will need to add a token to the end of your Nightscout URL when configuring your Endpoint.

1. In your Nightscout Admin Tools, add a new subject and give it the "readable" role.
- If you **really** would like to be super specific, you could create a new role and set the permissions to `api:*:read`.
1. After the new subject is created, copy the "Access Token" value for the new row in your subject table (**don't** copy the link, just copy the text).
1. At the end of your Nighscout URL, add `?token={yourtoken}`, where `{yourtoken}` is the Access Token you just copied. Your new URL should look like `https://{yourdomain}/api/v1/googlehome?token={yourtoken}`.

### Test your skill out with the test tool

Click on the "Test" tab on the top menu. This will take you to the page where you can test your new skill.
Expand Down
11 changes: 11 additions & 0 deletions docs/plugins/googlehome-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Overview](#overview)
- [Activate the Nightscout Google Home Plugin](#activate-the-nightscout-google-home-plugin)
- [Create Your DialogFlow Agent](#create-your-dialogflow-agent)
- [Do you use Authentication Roles?](#do-you-use-authentication-roles)
- [What questions can you ask it?](#what-questions-can-you-ask-it)
- [Updating your agent with new features](#updating-your-agent-with-new-features)
- [Adding support for additional languages](#adding-support-for-additional-languages)
Expand Down Expand Up @@ -56,6 +57,7 @@ To add Google Home support for your Nightscout site, here's what you need to do:
1. After the import finishes, click the "DONE" button followed by the "SAVE" button.
1. In the navigation pane on the left, click on "Fulfillment".
1. Enable the toggle for "Webhook" and then fill in the URL field with your Nightscout URL: `https://YOUR-NIGHTSCOUT-SITE/api/v1/googlehome`
- If you use Authentication Roles, you'll need to add a bit to the end of your URL. See [the section](#do-you-use-authentication-roles) below.
1. Scroll down to the bottom of the page and click the "SAVE" button.
1. Click on "Integrations" in the navigation pane.
1. Click on "INTEGRATION SETTINGS" for "Google Assistant".
Expand All @@ -65,6 +67,15 @@ To add Google Home support for your Nightscout site, here's what you need to do:

That's it! Now try asking Google "Hey Google, ask *your Action's name* how am I doing?"

### Do you use Authentication Roles? ###

If you use Authentication Roles, you will need to add a token to the end of your Nightscout URL when configuring your Webhook.

1. In your Nightscout Admin Tools, add a new subject and give it the "readable" role.
- If you **really** would like to be super specific, you could create a new role and set the permissions to `api:*:read`.
1. After the new subject is created, copy the "Access Token" value for the new row in your subject table (**don't** copy the link, just copy the text).
1. At the end of your Nighscout URL, add `?token=YOUR_TOKEN`, where `YOUR_TOKEN` is the Access Token you just copied. Your new URL should look like `https://YOUR-NIGHTSCOUT-SITE/api/v1/googlehome?token=YOUR_TOKEN`.

### What questions can you ask it?

See [Interacting with Virtual Assistants](interacting-with-virtual-assistants.md) for details on what you can do with Google Home.
Expand Down

0 comments on commit 40ae606

Please sign in to comment.