Using Spring Security for authentication and authorization
Spring Security is a widely used project to enable authentication and authorization using many different mechanisms, such as form-based logic, header-based login (Basic), and so on. But, there are more complex scenarios, such as JWT, SSO, and OAuth2, that can also be enabled using Spring Security. In this section, we will look at how to use Spring Security with OAuth2 to configure an authentication and authorization mechanism for the Tweety application.
Understanding OAuth2
OAuth2 is an authorization contract that enables applications to be secured by providing limited access to user accounts that are available an on an HTTP service. Parties involved in an OAuth2 authorization are as follows:
- Resource: The protected artifact in the Resource Server
- Resource Owner: The owner of the resource being requested
- Resource Server: The server that has the resource being requested
- Authorization Server: The server that has the responsibility to authorize...