Having seen the basic fundamentals of what OAuth 2.0 is and how it works, we will now look at the integration of OAuth in Spring Security. We will continue to work with the same application that we created for LDAP, and will make the necessary changes for OAuth integration.
For the OAuth demonstration, we will use readily available authorization providers. Spring Security supports Google, Facebook, Okta, and GitHub providers out of the box. Choosing one of them would only require certain configurations, and things would start to work. We will select Google as an authorization server (provider) to build OAuth for our application. The grant type that we will use in this integration is authorization code.
Every authorization provider supports some sort of mechanism that enables the clients to establish a connection with the service. This process is known as application registration.