1

EDIT: On phone assistant its working now problem just exist in google action simulator

I just try to setup Google Actions SDK account Linking with implicit grant and try to test it in Simulator.

First question is this even possible in Simulator?

  1. To Do so I added at the action console account linking with the type implicit grant to my action.
  2. The url I used is working.
  3. Now I added a signup request to my action. For testing so if I write signup in simulator the server response with:

{ conversationToken: JSON.stringify(state), expectUserResponse: true, expectedInputs: [ { inputPrompt: { initialPrompts: [ { textToSpeech: "PLACEHOLDER_FOR_SIGN_IN" } ], noInputPrompts: [] }, possibleIntents: [ { "intent": "actions.intent.SIGN_IN", "inputValueData": {} } ], speechBiasingHints: [] } ] }

  1. After this the server didn't request the sign in page route (the address is correct!). It just responds with SignIN intent ERROR :

{ "isInSandbox'": false, "surface": { "capabilities": [ { "name": "actions.capability.AUDIO_OUTPUT" }, { "name": "actions.capability.SCREEN_OUTPUT" } ] }, "inputs": [ { "rawInputs": [ { "query": "i think so", "inputType": "VOICE" } ], "arguments": [ { "name": "SIGN_IN", 'extension': { "@type": "type.googleapis.com/google.actions.v2.SignInValue", "status": "Error" } } ], "intent': "actions.intent.SIGN_IN" } ], "device": { "locale": "en-US" }, "conversation": { "conversationId": "1494606917128", "type": "ACTIVE", "conversationToken": "[\"_actions_on_google_\"]" } }

Why? Where is the problem? Can I see a error message somewhere?

Here is what happen in the simulator between 3 and 4:

enter image description here enter image description here

Alex Bravo
  • 1,601
  • 2
  • 24
  • 40
shortQuestion
  • 473
  • 2
  • 16
  • After step 3, what is shown in the Simulator Response tab? – Prisoner Nov 20 '17 at 18:50
  • Nothing, with nothing I mean it sends directly to the server the error message that I posted in 4.) and when I response to that error than it shows my response, if not than it shows nothing. So actually it shows nothing after step 3. – shortQuestion Nov 20 '17 at 21:48
  • 1
    Do you see any component of step 3 in the response in the emulator? Is there anything in the error tab? Can you post a screen shot? – Prisoner Nov 20 '17 at 21:58
  • No its complete empty, i mean i can post a screenshot but its totally useless. It just directly says error and the simulator logs seems to be useless. – shortQuestion Nov 20 '17 at 22:06
  • Please post screenshots of the contents of the tabs. Even what you see as empty may help. – Prisoner Nov 20 '17 at 22:08
  • Please see above I added the picture it shows the response inside the tap after I wrote signup in the simulator it sends a text intent to my server which now response with the request for the signup (see code after step 3.) ) that is send to the Google Server which response with the error you can see after 4.) the Hallo message is the answer from my server on the signup Error you can see after step 4. – shortQuestion Nov 21 '17 at 10:09
  • Ok, can you also click on the "response" tab int he simulator and show the screenshot from that? Also a screen shot of the intent you think is handling the "signup" message. – Prisoner Nov 21 '17 at 21:18
  • What you mean with intent that is handling the signup message? You mean the JSON I send to the server (see at point 3.) The picture is added above. but As I said the content of response tab and simulator tabs right doesnt change at all... never ever. So beside of showing this it is pointless. – shortQuestion Nov 22 '17 at 09:00
  • 1
    Sorry, I had missed (twice) that you were using AoG API. I was trying to confirm what was being called. That those tabs remain blank is extremely odd. What is the logic you are using to determine that "signup" is supposed to trigger the SIGN_IN request? How are you confirming this is what is sent? – Prisoner Nov 22 '17 at 10:46
  • If i type in signup into the action simulator it sends an text intent to my server. And the server answer with sign_in it logs the response to the console and a log file so I can see the json there. And I know its sends it cause it give me the sign in error back. furthermore I used curl to check the extact output. There is the JSON below 3. is exactly the JSON out of the signup curl. The tabs from the simulator are always empty I dunnot know why. maybe its necessary to send cards? And not only speech output. – shortQuestion Nov 22 '17 at 10:52

2 Answers2

1

Is it same when you use the phone app? For me it opens an embedded browser with my /auth endpoint, which the simulator doesn’t do.

ghostdogpr
  • 631
  • 5
  • 9
0

I am able to make it WORKING after a long time. We have to enable the webhook first and we can see how to enable the webhook in the dialog flow fulfillment docs If we are going to use Google Assistant, then we have to enable the Google Assistant Integration in the integrations first. Then follow the steps mentioned below for the Account Linking in actions on google:-

  1. Go to google cloud console -> APIsand Services -> Credentials -> OAuth 2.0 client IDs -> Web client -> Note the client ID, client secret from there -> Download JSON - from json note down the project id, auth_uri, token_uri -> Authorised Redirect URIs -> White list our app's URL -> in this URL fixed part is https://oauth-redirect.googleusercontent.com/r/ and append the project id in the URL -> Save the changes

  2. Actions on Google -> Account linking setup 1. Grant type = Authorisation code 2. Client info 1. Fill up client id,client secrtet, auth_uri, token_uri 2. Enter the auth uri as https://www.googleapis.com/auth and token_uri as https://www.googleapis.com/token 3. Save and run 4. It will show an error while running on the google assistant, but dont worry 5. Come back to the account linking section in the assistant settings and enter auth_uri as https://accounts.google.com/o/oauth2/auth and token_uri as https://accounts.google.com/o/oauth2/token 6. Put the scopes as https://www.googleapis.com/auth/userinfo.profile and https://www.googleapis.com/auth/userinfo.email and weare good to go. 7. Save the changes.

  3. In the hosting server logs, we can see the access token value and through access token, we can get the details regarding the email address.

  4. Append the access token to this link "https://www.googleapis.com/oauth2/v1/userinfo?access_token=" and we can get the required details in the resulting json page.
  5. accessToken = req.get("originalRequest").get("data").get("user").get("accessToken")
    r = requests.get(link) print("Email Id= " + r.json()["email"]) print("Name= " + r.json()["name"])

P.S. You can use the Grant Type as Implicit also instead of Authorisation code.

Gregor Doroschenko
  • 11,488
  • 5
  • 25
  • 37
Jatin Mahajan
  • 149
  • 1
  • 8
  • Is this working on simulator than? I have to update the question cause it runs since some months on assistant on phone but the simulator still just send error when i try it. – shortQuestion Apr 06 '18 at 21:54
  • In the simulator, it will say that the account is not linked yet but the button to link the account will not come. It will come only on some device like mobile or tablet linked with your Google account – Jatin Mahajan Apr 08 '18 at 04:45