Java

tut-spring-boot-oauth2

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

S

spring-guides

Dernière activité 1 juil. 2026
spring-guides/tut-spring-boot-oauth2

941

étoiles

756

forks

49

issues ouvertes

Ce README est souvent en anglais.

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

Social Login with Spring Boot and OAuth 2.0

Table of Contents

This guide shows you how to build a sample app doing various things with "social login" using OAuth 2.0 and Spring Boot.

It starts with a simple, single-provider single-sign on, and works up to a client with a choice of authentication providers: GitHub or Google.

The samples are all single-page apps using Spring Boot and Spring Security 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.

All samples are implemented using the native OAuth 2.0 support in Spring Boot.

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 authentication using an external OAuth 2.0 provider.

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 GitHub (or similar) and get client credentials for your own host addresses. And remember not to put those credentials in source control!

Projets similaires

Getting Started withg Spring Security OAuth:

Javaoauthspring-securityspring-security-oauth
BBaeldung
2 k étoiles1,9 k

Getting Started with Spring Boot 3:

Java
Eeugenp
37,3 k étoiles53,2 k

Spring Security and Angular:: A tutorial on how to use Spring Security with a single page application with various backend architectures, ranging from a simple single server to an API gateway with OAuth2 authentication.

Java
Sspring-guides
1,7 k étoiles1,6 k