google_assistant 0.2.0 → 1.0.0.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/lib/google_assistant/user.rb +2 -1
- data/lib/google_assistant/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 995844f98cf4cf9b7781addf95ddc92a0b5cb9ae
|
|
4
|
+
data.tar.gz: 7787d278be43aa748921fd70c6597c6f35ffe96e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 364d269cad36246cad439cafcdf88dc29800e171366619c280f0518162a136304505b96ff39d4da519b7bd3535b7d232b9d5ab0e7dfa322a5fbecabed42210a0
|
|
7
|
+
data.tar.gz: c4e46c8cf7ed4d1f27693ff8d5646a526bc0ab7f2fedaffffa4c7d1fed46c480bba0af57658ae327178b7107227cb43fbdb4f4fe0839aa6577dc72511787ac99
|
data/README.md
CHANGED
|
@@ -291,6 +291,24 @@ You can use any hosting platform.
|
|
|
291
291
|
|
|
292
292
|
6. Use the [web simulator](https://developers.google.com/actions/tools/web-simulator) to simulate. Or better yet, if your Google Home device is logged into the same account you're using to build your action, you can say "OK Google, talk to my action" to test it out directly on your device.
|
|
293
293
|
|
|
294
|
+
## Authentication
|
|
295
|
+
|
|
296
|
+
You can require users to log in to your service before using your assistant. Read about it in [Google's documentation](https://developers.google.com/actions/develop/identity/oauth2-code-flow). The basic flow is this:
|
|
297
|
+
|
|
298
|
+
1. User tries to talk to your assistant
|
|
299
|
+
2. Google tells the user they need to sign in, which they can do via the Home app on their phone
|
|
300
|
+
3. The Home app links the user to your Oauth endpoint
|
|
301
|
+
4. User signs in to your app
|
|
302
|
+
5. Google stores the user's Oauth access and refresh tokens
|
|
303
|
+
6. For each subsequent request the user makes to your assistant, Google sends the user's access token so you can identify the user
|
|
304
|
+
|
|
305
|
+
In order to set this up in your assistant, the basic instructions are as follows. Read Google's documentation for the full details.
|
|
306
|
+
|
|
307
|
+
1. Implement Oauth in your application
|
|
308
|
+
2. Set up an Oauth client in the [Google Developer Console](https://console.developers.google.com)
|
|
309
|
+
3. In the application's `action.json` file, set up account linking according to [Google's Instructions](https://developers.google.com/actions/develop/identity/account-linking#enabling_account_linking)
|
|
310
|
+
4. Use `assistant.user.access_token` to identify the user
|
|
311
|
+
|
|
294
312
|
## More information
|
|
295
313
|
|
|
296
314
|
Check out Google's instructions at https://developers.google.com/actions/develop/sdk/getting-started for more detail on writing and testing a Google Assistant action.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module GoogleAssistant
|
|
2
2
|
class User
|
|
3
|
-
attr_reader :id, :profile
|
|
3
|
+
attr_reader :id, :profile, :access_token
|
|
4
4
|
|
|
5
5
|
def initialize(opts)
|
|
6
6
|
@id = opts["user_id"]
|
|
7
7
|
@profile = opts["profile"] || {}
|
|
8
|
+
@access_token = opts["access_token"]
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
def display_name
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google_assistant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0.beta
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aaron Milam
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -94,9 +94,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
94
94
|
version: '0'
|
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
|
97
|
-
- - "
|
|
97
|
+
- - ">"
|
|
98
98
|
- !ruby/object:Gem::Version
|
|
99
|
-
version:
|
|
99
|
+
version: 1.3.1
|
|
100
100
|
requirements: []
|
|
101
101
|
rubyforge_project:
|
|
102
102
|
rubygems_version: 2.5.1
|