badge icon

This article was automatically translated from the original Turkish version.

Article
oauth-2-sm.png
OAuth 2.0
Release date
October 1, 2012
Developer
IETF (Internet Engineering Task Force)
Standard
RFC 6749

In internet-based systems, various authorization protocols are used to ensure secure and controlled access to user data. These protocols enable third-party applications to access specific resources without the user directly sharing their credentials. OAuth 2.0 is the authorization protocol developed for this purpose.


OAuth 2.0 is an authorization protocol, not an authentication protocol. This distinction is important; because OAuth 2.0 focuses on granting access rights to specific resources rather than verifying user identity. It holds significant importance in terms of internet security and user data privacy and is widely used in modern web applications.

History

The OAuth protocol was first developed in 2006 and was officially standardized in 2012 by the IETF (Internet Engineering Task Force) as RFC 6749. OAuth 2.0 is more flexible, extensible, and easier to implement than its predecessor, OAuth 1.0.

Core Components

The OAuth 2.0 protocol consists of four main components: the resource owner (user), the client (application), the authorization server, and the resource server. Interactions between these components occur through access tokens. The protocol supports four main authorization types for different access scenarios: authorization code, implicit, resource owner password credentials, and client credentials. Additionally, major technology companies such as Google, Facebook, and Microsoft have developed their own specialized OAuth 2.0 implementations based on this core protocol, adding additional security layers and authentication features to enhance its functionality.

Authorization Code Flow

The Authorization Code Flow is one of the most common and secure authorization types in the OAuth 2.0 protocol. It is specifically designed for web applications that operate on the server side. The process works as follows:


  1. Redirection and Permission Request: The user is redirected by the application to the authorization server. The authorization server verifies the user’s identity and presents the application’s request for access permission. The process continues once the user grants consent.
  2. Obtaining the Authorization Code: After the user grants consent, the authorization server sends a short-lived “authorization code” to the client application, typically via a redirect URI.
  3. Obtaining the Access Token: The application uses the received authorization code to make a backend (server-to-server) request to the authorization server. This request also includes the client’s credentials. If the server validates the code and the client authentication, it issues an access token to the application. Optionally, a refresh token may also be provided for long-term session management.
  4. Accessing Protected Resources: The application can use the access token to request user data from the resource server. The validity period and scope of the access token are limited according to previously granted permissions.


Authorization Code Flow (

The primary advantage of the Authorization Code Flow is that access tokens are not directly transmitted to the client’s browser but are securely obtained on the server side. This architecture significantly reduces the risk of credential and access data exposure.

OpenID Connect

OpenID Connect is an authentication protocol built on top of the OAuth 2.0 protocol, focused on verifying user identity. While OAuth 2.0 provides only authorization, OpenID Connect adds additional layers to enable secure and standardized verification of user identity. OpenID Connect uses JSON Web Tokens (JWT) in the form of ID tokens to carry user identity information and enables a Single Sign-On experience across different applications. Today, many major technology companies and services prefer the OpenID Connect standard for authentication.

OpenID Configuration

The OpenID Connect standard defines a standard endpoint named .well-known/openid-configuration to simplify authentication and authorization processes. This endpoint provides the authorization server’s configuration details—for example, supported authorization methods, token endpoints, and user info endpoints—in JSON format. Client applications query this endpoint to dynamically and reliably obtain information about the protocol features and URLs supported by the authorization server. This enables applications to easily adapt to different authorization servers and automates configuration processes. For example, you can view Google’s openid-configuration endpoint.

Use Cases

OAuth 2.0 has numerous use cases, including login via social media accounts and allowing third-party applications to access services such as calendars, email, or files. Major technology companies such as Google, Facebook, and Microsoft widely use this protocol.

Security and Criticisms

OAuth 2.0 mandates the use of secure communication protocols such as HTTPS to ensure security. However, security vulnerabilities can arise if the implementation is poorly configured. Additionally, some experts note that the flexibility of OAuth 2.0 can lead to challenges in implementing complex security requirements.

Bibliographies







Auth0. "What is OAuth 2?" Accessed May 22, 2025. https://auth0.com/intro-to-iam/what-is-oauth-2

Google Developers. "Google Identity Platform." Accessed May 22, 2025. https://developers.google.com/identity/protocols/oauth2.

Hardt, Eran. "The OAuth 2.0 Authorization Framework." *RFC 6749*, Internet Engineering Task Force, October 2012. Accessed May 22, 2025. https://tools.ietf.org/html/rfc6749.

Meta for Developers. "Facebook Login." Accessed May 22, 2025. https://developers.facebook.com/docs/facebook-login/.

Sakimura, Nat, John Bradley, Michael Jones, Breno de Medeiros, and Chuck Mortimore. "OpenID Connect Core 1.0." OpenID Foundation, November 2014. Accessed May 22, 2025. https://openid.net/specs/openid-connect-core-1_0.html.

Author Information

Avatar
AuthorOsman AslancanDecember 8, 2025 at 10:10 AM

Tags

Discussions

No Discussion Added Yet

Start discussion for "OAuth2" article

View Discussions

Contents

  • History

  • Core Components

  • Authorization Code Flow

  • OpenID Connect

    • OpenID Configuration

    • Use Cases

    • Security and Criticisms

Ask to Küre