Google 正在更新他们的 OpenID Connect 实现以完全符合规范,我会遇到什么问题吗?

Google is updating their OpenID Connect implementation to be fully spec compliant, will anything break for me?

Google 更新了他们的 OpenID Connect 端点以完全 spec compliant, as part of the OpenID Certification 努力。我依靠 OpenID Connect 来让我的用户使用 Google 登录。作为依赖方,我需要做些什么来避免因这些变化而中断吗?

这取决于您如何通过 Google 使用 OpenID Connect。如果您按照文档的建议通过获取 https://accounts.google.com/.well-known/openid-configuration 执行动态发现,那么您的服务器与 Google 交互的方式将会改变 ,但只有在以下情况下您才会受到影响您的实现无法处理更新的、更符合规范的响应。

另一方面,如果您直接对各种端点(即 auth 和 token 端点)进行了硬编码,那么您将与这些更改隔离开来,但您应该考虑迁移到新的端点。

新端点的主要变化包括:

  1. Id 令牌颁发者(iss 声明)从 accounts.google.com 更改为 https://accounts.google.com(在迁移期间,您应该接受任一值)
  2. 如果您的 response_type 包含 id_token,您必须包含 nonce 否则您的请求将出现硬错误。

如果您使用的是符合规范的 OpenID Connect 库,那么理论上一切都应该像以前一样继续工作。

为避免在迁移期间出现任何可能的问题(或者如果您的网站突然崩溃),您可以在闲暇时硬编码以下 URL 以获取以前的发现文档:https://google.com/accounts/o8/well-known-openid-configuration-old.json (or use the values within to hardcode your auth and token endpoints). As this document points to old versions of the endpoints, you will get the old behavior. Then you can test your products with the latest endpoints (as found in the current discovery document)。

要比较差异或查看完整的新旧版本,请参阅 this gist