gpt4 book ai didi

spring-security - Spring安全和使用谷歌登录

转载 作者:行者123 更新时间:2023-12-02 03:42:59 26 4
gpt4 key购买 nike

我在我的 Web 应用程序 spring security login 中使用 google open id 实现,如 article 中所述

但有没有办法允许某些 google apps 域的所有成员登录,而无需明确列出所有用户?

或者,至少,保留用户列表,但使 ID 与主机无关(现在谷歌为每个部署主机生成不同的 ID)

最佳答案

我们通过将相应的域列入白名单来做到这一点:

  • 实现 AuthenticationUserDetailsS​​ervice
  • 覆盖 loadUserDetails() 并检查域

您可以在 GitHub (Sample Code) 上查看确切的代码,或在此处阅读我们如何实现 Spring 和 OAuth:https://techdev.io/en/developer-blog/using-spring-and-oauth-in-trackr

关于spring-security - Spring安全和使用谷歌登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18944985/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com