Dailogflow account unlinking using webhook - dialogflow-es

I have successfully linked the account in dialogflow. I can also validate the access token received in the request.
but in case of invalid access token I want to ask the user to again link their account by first unlinking the account from the webhook and then send the actions.intent.SIGN_IN.
I am able to do the unlinking from test simulator of Actions Console manually but is there any way to unlink the account from the webhook or is there any way to unlink the account programmatically?

The only way to do this from your webhook is to return a status_code of 401. Yep, you heard that right. The expected solution is to return an error.
I wouldn't believe it myself, if it didn't come straight from AoG support...
return a HTTP 401 Unauthorized error from your webhook, to any request to indicate to Google that a new access token must be acquired. Google then exits the app with the error message "app assistant isn't responding right now. Try again soon."
When the user invokes your app again, he is required to account link.
So the expected solution is to for your action to respond as if your webhook is broken, expect the user to try again despite the "error", then they'll not have a token and will follow the unlinked flow.

Related

How do I fix authorization error 403? which I am getting while authorizing my api on "developer.google.com/oauthplayground"

I am trying to create an api which will send users mails (using nodemailer).
On the final stage of Google OAuth2 steps (after providing client id and client secret and selection of gmail account) I' am getting an error 403 "Authorization error". For this issue I have created several project and apis but the result is same.
Error 403: access_denied
The developer hasn’t given you access to this app.
It’s currently being tested and it hasn’t been verified by Google.
If you think you should have access, contact the developer (sebastianrobi29#gmail.com).
How do I fix this issue?

Getting (400) Bad Request in response while try get access token for docusign

I am able get JWT access token with account id#10540382, which I created for our company e-signature implementation. I done JWT implementation with this account and everything goes well. But now company provided my new account id#11024495. But with this new account I am not getting access token. Token API https://account-d.docusign.com/oauth/token now return "The remote server returned an error: (400) Bad Request."
Can someone from DocuSign help me, what is issue with new account id#11024495?
The reason is missing consent.
Your client will need to provide consent by calling this url from the browser window
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature+impersonation&client_id=integrator_key&redirect_uri=your_encoded_redirect_url

How do I fix a verification token error on slack channel for azure bot services?

I created a simple bot that I wanted to test channel integrations on and it worked properly in the Web Chat and in the Facebook Messenger integration. However when I followed the steps outlined here, I keep getting an error in the Issues column of the Slack bot that says: Verification token mismatch. Please check your bot's Slack configuration and make sure the verification token is correct.
Azure error message
The fields I used for setting up the azure service
I have tried regenerating the verification token several times and I still get the same error. I have also restarted my local bot, restarted ngrok, and changed the endpoint to the new ngrok address.
You could try using signed secrets functionality instead of token verification. See:
https://api.slack.com/interactivity/slash-commands#how_do_commands_work
"This is a verification token, a deprecated feature that you shouldn't use any more. It was used to verify that requests were legitimately being sent by Slack to your app, but you should use the signed secrets functionality to do this instead."

Dialogflow Account Unlinking

I've set up account linking with custom OAuth endpoints for Google Assistant (using Dialogflow) but can't find a way to sign a user out. There are no built-in actions to trigger sign out like there are for sign in (actions_intent_SIGN_IN) nor is there a way to empty out the "user" object containing their access token passed in each request to my webhook.
Has anyone found out how to manually unlink a user's account?
Similar question to Account Unlinking on Actions on Google but no feasible answer was provided.
At any time, you can return an HTTP 401 "Unauthorized" code and Google will consider the token invalid in the future. This is the equivalent of logging the user out".
(See here, but this is true for the Auth Code flow as well.)

api.ai webhook authentication

I've successfully completed account linking on api.ai, and now I'm trying to execute a webhook. The problem here is that I need the token that was generated during the linking process to go into the authentication field. Otherwise I will always get a "403" error back. How can you change the auth token in the webhook header field dynamically for each user that issues a Google Home voice command?
For all I know that's not currently possible. I pretty much had the same issue, and I resorted to connecting to an intermediate server that handles the webhook, extracts the access token (available via the actions-on-google node.js API as getUser().access_token), and then forwards the request in the right format to the original host.

Resources