经过反复试验,在我看来,Google OIDC 在不提供客户端机密的情况下不支持代码流:https : //developers.google.com/identity/protocols/oauth2/native-app#exchange-authorization-code
根据 SPA 的最新最佳实践 ( https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13 ),代码流 + PKCE 是处理身份验证的推荐方式。有没有人知道让 Google 的代码流接受 code_challenge 而不是 client_secret 所需的任何技巧?也许是一个虚假的秘密?
oauth-2.0 single-page-application openid-connect google-identity pkce