4
votes

Is there any way to logout Or switch the account in actions on google? I am using account linking with Google (OAuth and Google SignIn) I want to do something like this that if the user says "Logout me from this account OR switch to another account", the action should logout him and open the google authentication.

I saw some of the Helpers intent in the documentation but not found any Helper for signout/logout.

Could you please help me that how can I logout the user by saying "logout from account or switch to another account"

2

2 Answers

2
votes

Keep in mind that "Account Linking" isn't really logging in. It is connecting the Google Assistant account they're using to the account you use on your system. If you're using just Google Sign In for Assistant, then you just want access to the information about the account they're using.

So "logging out" isn't quite what you're asking to do. In the first case, you want to "unlink" their Assistant account from the account on your system. In the second case, you want to forget who they are.

To do the "unlinking", you can return HTTP code 401 "Unauthorized". This will force the Assistant to discard any tokens they have for the user. Users can also do the unlinking through your directory listing.

Forgetting who they are is more difficult. There is nothing in AoG that does this directly, although you can direct them to a page that calls the sign out method for Google Sign In. They can also do the unlinking through the directory listing or through Google's account management page.

0
votes

Account linking can be turned off by clicking at that account logo below in case you want to test the intent again and redirected to sign in automatically every time. enter image description here