OAuth2 allows third-party applications to receive a limited access to an HTTP service which is either on behalf of a resource owner or by allowing a third-party application obtain access on its own behalf. Thanks to OAuth2, service providers and consumer applications can interact with each other in a secure way.
In OAuth2, there are 4 roles:
Resource Server: the server that hosts the protected resources and provides access to it based on the access token.
Server and Client OAuth2 components supports PKCE (Proof Key for Code Exchange), which is an extension to the Authorization Code flow to prevent CSRF and authorization code injection attacks (RFC 7636).