This recipe shows you how to use Spring Security 5 to seamlessly implement an OpenID Connect Relying Party providing more than one authentication method. After reading this recipe, you will be able to enable Google and Microsoft authentication to your website.
To run this recipe, you will need Java 8, Maven, Spring Web, and Spring Security. To ease the project creation step, use Spring Initializr athttp://start.spring.io/and define the dependencies asWeb
,Thymeleaf
, andSecurity
(this will properly declare all the Spring Boot starters needed for this recipe).
Note
As we need to use Spring Security 5, let's change the version of Spring Boot onthe Spring Initializr website to 2.0.0.M4 (do not forget to set up the Artifact
and Group
names).
Besides the fact that you have to register an application on Google, you also need to register an application on Microsoft Azure. Azure is the Microsoft Cloud platform where...