Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement Openid connect and 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.

First, I got UserInfo object thanks by following nice direction. https://oauthssodemo.appspot.com/step/1

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

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.

like image 314
zono Avatar asked Aug 07 '12 15:08

zono


People also ask

How would you implement OpenID Connect identity provider?

Open the IAM console at https://console.aws.amazon.com/iam/ . In the navigation pane, choose Identity providers, and then choose Add provider. For Configure provider, choose OpenID Connect. For Provider URL, type the URL of the IdP.

How do I provide security to spring application?

For adding a Spring Boot Security to your Spring Boot application, we need to add the Spring Boot Starter Security dependency in our build configuration file. Maven users can add the following dependency in the pom. xml file. Gradle users can add the following dependency in the build.

Does OpenID use JWT?

OpenID Connect is built on the OAuth 2.0 protocol and uses an additional JSON Web Token (JWT), called an ID token, to standardize areas that OAuth 2.0 leaves up to choice, such as scopes and endpoint discovery.


1 Answers

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.

like image 171
Romain F. Avatar answered Sep 20 '22 01:09

Romain F.