简体   繁体   中英

Actions on Google - How to revoke account linking?

Here is my situation : I develop a Google Assistant application with Dialogflow. My service needs user to be connected to their account. So I implemented the OAuth 2.0 Authorization Code Flow as explained in the account linking Google guide . Now my users can link my Assistant app to their account to vocally make action on it. It's work great, no problems with that.

My question is here : I have to give the possibility to my users to revoke the link between Google Assistant and their account. To do so I remove authorizations on my side and naturally returns a 401 response "invalid_grant" when I receive a request from the Assistant. My question is how can I notify Google that an access token has been revoked and that the user needs to relink the Assistant App to his account. Usually the assistant notify the user by the following :

It looks like your MyAppName account is not linked yet

Without that, Google keeps trying to send me requests until he does a refresh token and receive a 401 response. Is there an API or a way to directly revoke authorization on the Google Assistant side?

Thanks for any answers ;-)

Sadly, Dialogflow do not seems to reset the token with a status 401 error response.

Google exposes an API for revoking access and refresh tokens.
For that, you have to send the following request
https://accounts.google.com/o/oauth2/revoke?token={token} .

See the different implementations

EDIT : It seems you only have to make Dialogflow reset its state. Just proceed to make an edition on Dialogflow console seems to clean the access token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM