我们已经实现了Google登录https://developers.google.com/identity/sign-in/web/backend-auth。
根据文档https://developers.google.com/identity/protocols/OpenIDConnect#obtainuserinfo和最佳实践(从第一个链接开始),google user_id(sub
)是唯一标识符,不能更改。
sub
>用户的标识符,在所有Google帐户中都是唯一的,并且从未重复使用。一个Google帐户可以在不同的时间点接收多封电子邮件,但是子值永远不会改变。在应用程序中将sub用作用户的唯一标识符键。
但是,当我们在系统中拥有一个帐户并使用来自id_token的电子邮件时,我们会遇到这种情况,但是google user_id与以前注册时所用的帐户不同。
问题:怎么回事?我可以信任来自id_token的电子邮件并将新的google_user_id链接到内部帐户吗?