
Tech Glossary
OAuth 2.0
OAuth 2.0 is an authorization framework widely used to allow third-party applications to access user data from web services without requiring the user to disclose their credentials. This approach has made OAuth 2.0 a standard for securing APIs, enabling users to authorize applications to interact with their accounts on services like Google, Facebook, and Twitter, without exposing passwords.
OAuth 2.0 operates based on the concept of access tokens, which are granted to third-party applications upon user consent. The process involves four primary roles:
Resource Owner: The user who authorizes access to their resources.
Client: The application requesting access to the user’s resources.
Authorization Server: Issues the access tokens after authenticating the user and obtaining their consent.
Resource Server: Hosts the user’s data and validates the access tokens to permit access.
The authorization flow begins when the client requests authorization from the resource owner. Once granted, the authorization server issues an access token to the client, which the client can use to access resources on the resource server. OAuth 2.0 supports various grant types or flows, including Authorization Code Grant for web apps, Implicit Grant for single-page applications, Resource Owner Password Credentials Grant, and Client Credentials Grant for server-to-server communication.
OAuth 2.0 enhances security by allowing users to control the level of access they grant and by enabling short-lived tokens, which can be revoked or refreshed. This approach minimizes risks associated with password sharing and has become the foundation for securing API interactions, particularly in mobile, cloud, and web applications.