且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AOG隐式帐户链接-如何重置?

更新时间:2022-10-17 10:14:14

如果您使用的是隐式OAuth流,则您的操作可以


I have setup an implicit account linking page. I tested it with AOG - all good, surface checked, user sent over to the phone app if needed, link worked (status OK, accessToken present).

Now I can't figure out how to reset the user id or the account linking status to repeat this. It's not just testing. The user could need a new token for many other reasons.

Currently if I initiate a subsequent SING_IN it comes back immediately with an OK and the accessToken.

If you are using the Implict OAuth Flow, then your Action can revoke the token during webhook fulfillment. Instead of returning a normal response (for example, saying something using the actions-on-google library or by returning JOSN), your webhook should return an HTTP response code of 401. This will force the user to go through the login when next called. Exactly how you do this will depend on the library you're using.

When you're in production, in the listing of Actions users will see that their account has been linked to your Action and can unlink it.