How to not exit a conversation after account linking? - actions-on-google

When testing my app in the Simulator using a Speaker (e.g. Google Home), it always says "'MyApp' left the conversation" after successfully linking. Here is an example:
User signs up via the web site that I created for MyApp (i.e. they have an account associated with their Google email account).
User then tries to use MyApp using Google Home by saying "Talk to MyApp". They are greeted with this message:
Before you can use MyApp, you'll need to be signed in with them. To do
that, they'll need some of your info. If you want more details, say
"Tell me more. " So, can I share your name, email address, and profile
picture with them?
User says, "yes" and their account is linked.
Google Assistant responds with "Great, they found your account, and they've linked it to Google." That is followed by the line, "'MyApp' left the conversation."
Because MyApp left the conversation in step 4, the user has to say, "Talk to MyApp" once more in order to actually start using the app.
So my question is, is there a way that I can link the account and not have MyApp leave the conversation automatically? When my TokenUrl responds back to Google in order to link the account, it can just send token_type, access_token, and expires_in according to the documenation. There doesn't seem to be any other mechanism to tell it to not end the conversation but this seems like something that should be supported.
Any ideas? Thanks.
EDIT#1 to further explain setup
I have tried to create an Intent in the Dialogflow console and put "actions_intent_SIGN_IN" (from https://developers.google.com/actions/reference/rest/intents) and set it to be fulfilled by my webhook but this never fires.
In the Dialogflow console > Integration Settings, under "Explicit Invocation" I have "Welcome" (a.k.a. my Welcome intent that hands the WELCOME and GOOGLE ASSISTANT WELCOME Events. The Sign in required checkbox is checked next to this.

This is a problem with your Action, not with your OAuth server. It sounds like your Action isn't handling the Intent that reports the sign-in is a success or a request that contains the user's auth token.
Check your logs, including the logs for your webhook, to make sure there are no errors in that stage.

Related

Firebase: Standard User Registration/Activation Workflow

I need to implement a standard user registration/activation workflow with Firebase. There doesn't seem to be an obvious way to implement this. When I say "standard", I mean how most email/password accounts work - not necessarily specific to Firebase. I'm sure you're familiar with this. This is the workflow:
User enters their username/password on a form with some validation and submits details
The back-end creates the user record in the database, but the account remains deactivated (i.e. user cannot authenticate - the activated flag is set to false)
The back-end sends an email to the user with a link to activate the account
The user clicks the link in their email which triggers activation. This is probably a Web API of some description.
At this point, the user record's activated flag ticks over to true, and the user can now authenticate
The link probably also has a deep link that opens the app or navigates to a web page
The user can now log into the app
How do I configure Firebase to do all this?
Currently, the app allows the user to register. I am using the Flutterfire SDK. I call createUserWithEmailAndPassword, which successfully creates the user in Firebase. But, the user is already activated. The user should have a state of "disabled" in firebase until the account becomes activated. I can't find any settings to default the user to disabled when the account is first created.
I also managed to get Firebase to send out an activation email by calling sendSignInLinkToEmail, but this call is really designed for email authentication - not email activation. Opening the link should activate the account, but I have not figured out how to do this. This documentation makes it sound like it is possible. Perhaps, the Flutterfire SDK is missing this? I don't want to allow people to log in without a password. I only want to use this call to send out an email.
What am I missing here? Is this non-standard behavior for Firebase? If so, why? If the user is allowed to use an app with an email address that is not activated, they can impersonate someone else. We need to confirm at least that they are custodians of the email address that they are claiming to have.
Do other Firebase people just not worry about this?
Lastly, I know I can achieve this by creating a collection for users in Firebase and putting an "activated" flag there. But, if I do that, I've got to write a cloud function that accepts the link and then updates the user in the collection based on the received link. But I thought this would be automatic in Firebase. If Firebase doesn't have this built-in, I have to put all the security over the top to stop users from authenticating when they have not yet activated their account.
This is a pretty valid concern. I suppose the way around this is to check whether the signed-in user is verified whenever the app is launched. The User object that is returned from Firebase Auth has an emailVerified flag. Check this page for more details.
Using this flag you can choose to show a different screen or pop-up that has a button to send a verification link to the registered email address. Until the user verifies this address, you can limit access to some of the app's screens if you want.
Please note that I have not checked if this emailVerified flag is true for sign ups using Federated login providers like Google Sign-in and Apple Sign In. You might want to check that out.

Actions Builder account linking throwing unexpected response

I'm new to using the actions builder console. I'm trying to create an application called "test for reminder" and trying to use account linking to get user's email. I followed all the steps listed out on the account linking tutorial. However, when I trigger the action, I'm getting the following response: "To use test for reminder, you’ll need an account with test for reminder. To create a new one for you, I’ll just need some info. If you want more details, say "Tell me more." So, can I ask Google for your name, email address, and profile picture?"
I'm not sure where that response is being triggered and how to go past it. Is it unable to verify my google account? If the user is verified, I have an event handler which is supposed to trigger if the user is verified, but that is not happening either.
Any insights would be appreciated

How to force logout linked account in actions-on-google?

In the docs, the sign in functionality looks like this:
app.intent('Default Welcome Intent', conv => {
conv.ask(new SignIn('To get your account details'))
})
However, I can't find how to force logout a user who just signed in. Anyone help me please? Thanks.
"Logging out" of an account linked with Google Sign In is tricky, particularly if you're using voice matching as well, since the account sent to the Action is the same account as the one you setup the Assistant device with.
You can go to https://myaccount.google.com/permissions and remove permission from the app/Action/project. Once you do this, the Action will no longer get your user information. (This isn't Action specific - it is a core component of Google Sign In across all platforms.)
The other alternative you have is to reset your Assistant device and set it up with a new account. Then when you go to the Action with this reset device, the account won't be linked.
A explicit sign-out function does not seem to be available. However, this can be a good design decision as the user should be logged in to a particular service "as long as possibly allowed". Therefore, when releasing your apps to production, consider looking at the validity of the access_token and refresh_token on your authorisation server to control the "login period".

Sabe REST API of Passenger Name Record NOT OPEN

The below the page did not open, please let me know the REST API of "create passenger name record". I tried to open the page several days, it always failed.
I know SOAP API of "create passenger name record", What I want is REST API.
https://developer.sabre.com/docs/rest_apis/air/book/create_passenger_name_record/
Uh oh. You don’t have access to see this page. Try logging in to see if that does the trick. If that doesn't work and you think you should have access to this page, send us a note. NOTE: if you are a current customer who just registered, it can take us up to 24 hours to set up your account to see the resources. If this is an urgent request please contact us through the site.
Please Sign In or Register.
Error Page as signed in - Image Capture
Which browser are you using?
I tryed it in different browsers (Firefox, Chrome, etc..) and in all of them I get a notice to sign in or register to access this page.
Obviously you're not signed in. Have you tried creating and or signing in?

Sorry, this action is not available in simulation

My test invocation name is "Mrs Tang", so i input "Talk to Mrs Tang", but it responds "Sorry, this action is not available in simulation"...
Does anybody know How can I resolve this error?
According to the doc:
Turn on the Web & App Activity, Device Information, and Voice & Audio
Activity permissions on the Activity controls page for your Google
account. You need to do this to use the Actions Simulator, which lets
you test your actions on the web without a hardware device.
And I had do what Jeremy Gordon suggested. To add a second google account in the GCP IAM console with a viewer action permission and then login with this second google account in an incognito window for the web simulator to work.
I had a related problem (I could test with my main developer account, but not my test credentials). I eventually got it working with the non-primary account.
The missing link for me was that when I was viewing the simulator, I was actually signed in to two accounts, my primary google account (developer account, shows up in the main frame of the page, upper right corner), and the account I authorized when 'starting' the simulator (email address shows up in the simulator frame), which was my test credentials. The second test account repeatedly gave me the "Sorry, this action is not supported in simulation" message, until I:
1) Added the test account as a Conversation API Viewer & Client in GCP IAM console
2) Visited the 'create link' (the one that comes up when you click share) in an incognito window, and signed into the secondary account there such that I was signed into only one account in that incognito window.
After that, invocations connected to the app.
Make sure you are logged into the same account you used to deploy the test action and that the deployment has been done within the past half hour or so. If you have not set all the information on the Actions on Google Console, you may need to use the invocation phrase "Talk to my test app".
I think sometimes I run into the same error. I get past it by toggling the Active switch off and on.
Same problem I encountered. You must be logged in via the secondary google account. Do logout from the account and login via the account that is paired with api.ai.
why I can't use google action in web simulator
I got this to work by saying "talk to my test app" or typing it in to the simulator prompt, that triggered my app to start in the simulator.
I had the same problem. I needed to set the location first (it defaults to Google-Headquaters), if you are in some other region (like in germany as i am).
Then go on with "Mit meiner Test-App sprechen" (Talk to my test app), or whatever it is in your language!
I did not get this message on my invocation, but on my my second input:"Sorry, this action is not available for your app.".
It turns out the simulator had left the conversation right after the invocation (and it did mention that in the small print).
This happened because I returned a FinalResponse for the invocation. And a final response is pretty final, it will terminate your conversation.
So, after a FinalResponse you can only get back in your action/conversation by a new invocation or a deep link. If you want to suggest questions/inputs, then you should return ExpectedInputs.
You might need to turn on Web & App Activity to let group members use some Google Assistant features.(if you are using organizational account)
https://support.google.com/assistant/answer/7219584?hl=en
If you are using any organization's Google Accounts then there might be an access issue. So use your own personal Gmail account.
Take a look here, organization's might not be given you access. So use your personal Gmail and follow the Docs, you will able to create your agent/ actions and able to test it with simulator as well as in android device.
At time of testing the Google Action you need to set the location to the country which you selected while developing or submitting your Google Action.
By default US is selected in testing but if your action is for one particular country only then you need to select that. You can see in image the field where you can select location