Skip to content

Spring Boot and OAuth2:: A tutorial on "social" login and single sign on with Facebook and Github

Notifications You must be signed in to change notification settings

tstavinoha/tut-spring-boot-oauth2

 
 

Repository files navigation

tags projects
security
javascript
rest
oauth
spring-security
spring-security-oauth
spring-boot

Social Login with Spring Boot and OAuth2

Table of Contents

This guide shows you how to build a sample app doing various things with "social login" using OAuth2 and Spring Boot. It starts with a simple, single-provider single-sign on, and works up to a self-hosted OAuth2 Authorization Server with a choice of authentication providers (Facebook or Github). The samples are all single-page apps using Spring Boot and Spring OAuth on the back end. They also all use plain jQuery on the front end, but the changes needed to convert to a different JavaScript framework or to use server side rendering would be minimal.

Conclusion

We have seen how to use Spring Boot and Spring Security to build apps in a number of styles with very little effort. The main theme running through all of the samples is "social" login using an external OAuth2 provider. The final sample could even be used to provide such a service "internally" because it has the same basic features that the external providers have. All of the sample apps can be easily extended and re-configured for more specific use cases, usually with nothing more than a configuration file change. Remember if you use versions of the samples in your own servers to register with Facebook or Github (or similar) and get client credentials for your own host addresses. And remember not to put those credentials in source control!

About

Spring Boot and OAuth2:: A tutorial on "social" login and single sign on with Facebook and Github

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 58.9%
  • HTML 20.8%
  • Shell 11.5%
  • Batchfile 8.2%
  • Ruby 0.6%