如何实现 Openid 连接和 Spring Security [英] How to implement Openid connect and Spring Security
问题描述
我是身份验证和授权的初学者,但我必须在工作中连接到 openid 连接提供程序.我对如何使用 Spring Security 有一些了解.
I am beginner of authentication and authorization but I have to connect to a openid connect provider on my job. I know a little about how to use Spring Security.
首先,我通过遵循很好的方向获得了 UserInfo 对象.https://oauthssodemo.appspot.com/step/1
First, I got UserInfo object thanks by following nice direction. https://oauthssodemo.appspot.com/step/1
然后我在下面找到了一个名为spring-security-oauth"的很棒的实现.我可以在 tomcat 上运行该应用程序并成功连接到 facebook.
https://github.com/SpringSource/spring-security-oauth
And then I found a great implementation named "spring-security-oauth" below. I could run the app on tomcat and connect to facebook successfully.
https://github.com/SpringSource/spring-security-oauth
下一步,我想使用spring-security-oauth"连接谷歌,但我完全不知道如何做到这一点.(说实话,我不知道openid connect和auth2有什么区别..)
As next step, I want to connect google by using "spring-security-oauth" but I do not know how to do that completely. (To be honest, I do not know how differences openid connect and aouth2..)
给我一个线索.任何帮助将不胜感激.
give me a clue. Any help will be appreciated.
推荐答案
这里是一个集成 Google Open Id Connect 和 Spring Security 的最小项目示例:https://github.com/fromi/spring-google-openidconnect对我来说,关键点是严重依赖 Spring OAuth2 来最小化所需的配置.
here is a sample minimal project integrating Google Open Id Connect with Spring Security: https://github.com/fromi/spring-google-openidconnect The key point for me was to rely heavily on Spring OAuth2 to minimize the configuration required.
这篇关于如何实现 Openid 连接和 Spring Security的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!