OAuth (Open Authorization) is an open-standard authorization framework that allows applications to access specific resources on a user’s behalf without sharing their passwords. It uses access tokens to grant limited permissions, making it possible for websites, mobile apps, and APIs to exchange information securely.
For example, when a calendar application asks permission to access your Google Calendar, OAuth enables that connection without requiring you to give the application your Google password.
Poin-poin utama
OAuth enables applications to access protected resources without exposing user credentials. Here are the essentials to understand.
- Kebenaran yang diwakilkan: OAuth allows applications to access selected resources on behalf of users without receiving their passwords.
- Token-based access: Applications use access tokens, scopes, and expiration controls to request authorized resources.
- Different from authentication: OAuth manages access permissions, while OpenID Connect (OIDC) adds user authentication capabilities.
- Multiple authorization flows: Authorization Code with PKCE supports interactive applications, while Client Credentials supports machine-to-machine access.
- Keselamatan perusahaan: IT administrators should review application permissions, restrict unnecessary access, and manage third-party integrations.

What is OAuth and why is it important?
OAuth is an authorization framework that allows one application to access protected resources managed by another service. Instead of sharing account credentials, users or systems grant permissions through an authorization server.
The framework is defined in the IETF OAuth 2.0 specification (RFC 6749).
OAuth matters because sharing passwords with third-party applications creates unnecessary security risks. With OAuth, organizations can provide access to selected resources without exposing the account owner’s credentials to requesting applications.
For IT administrators, OAuth also supports integrations between enterprise applications, cloud services, and APIs while enabling more controlled access.
Bagaimanakah OAuth berfungsi?
OAuth works by allowing an application to request access to protected resources, obtaining authorization, and exchanging an authorization code for an access token. The application then uses that token to access permitted resources without receiving the user’s password.
The four main components of OAuth
- Resource owner: The user or entity that controls the protected resources.
- Pelanggan: The application requesting access to those resources.
- Authorization server: The system responsible for granting authorization and issuing access tokens.
- Resource server: The API or service hosting protected resources and validating access tokens.
How OAuth works: Step-by-step example
Imagine an employee wants to connect a third-party scheduling application to their work calendar.
- Access request: The scheduling application requests permission to view calendar events.
- Authorization redirect: The application redirects the employee to the calendar provider’s authorization server.
- Authentication and consent: The employee signs in if necessary and approves the requested permissions.
- Authorization code: The server redirects the employee back to the application with a temporary authorization code.
- Pertukaran token: The application exchanges the code, using PKCE verification, for an access token.
- Resource access: The application presents the access token to the calendar API, which validates it and allows authorized access.
Throughout this process, the scheduling application never needs the employee’s calendar password.
What are OAuth access tokens, refresh tokens, and scopes?
OAuth uses access tokens, refresh tokens, and scopes to manage permissions and their duration.
Token akses
An access token is a credential that a client presents to access protected resources. Tokens can be opaque strings or structured formats such as JSON Web Tokens (JWTs). OAuth does not require one specific access-token format.
Token segar semula
Refresh tokens allow applications to request new access tokens when existing ones expire, without requiring the user to repeat the authorization process every time.
Refresh tokens are optional and must be securely protected.
Skop OAuth
Scopes represent permissions requested by an application.
For example, a scheduling application might request permission to read calendar events but not modify or delete them. The authorization server and resource server determine which permissions are granted and enforced.
What are the different OAuth 2.0 grant types?
OAuth 2.0 supports different authorization flows depending on the application and access requirements.
1. Authorization Code with PKCE
Authorization Code with Proof Key for Code Exchange (PKCE) is the recommended approach for interactive web, mobile, and desktop applications. PKCE helps prevent stolen authorization codes from being exchanged for tokens by unauthorized parties.
2. Client Credentials
The Client Credentials grant enables machine-to-machine authorization without a human user.
For example, an automated reporting service can obtain access to an internal API using its own application credentials.
3. Device Authorization Grant
This flow supports devices with limited input capabilities, such as smart TVs. Users authorize access through another device with a browser.
Older Implicit and Resource Owner Password Credentials grants are no longer recommended for new implementations under modern OAuth security guidance.
OAuth vs. OpenID Connect vs. SAML: What’s the difference?
OAuth, Sambungan OpenID (OIDC), and SAML are related identity and access standards, but they serve different purposes.
| Ciri | OAuth 2.0 | OpenID Connect | SAML 2.0 |
|---|---|---|---|
| Tujuan utama | kebenaran | Pengesahan | Authentication and identity federation |
| Mekanisme utama | Token akses | ID tokens and OAuth tokens | dakwaan SAML |
| Penggunaan khas | Akses API | User login and SSO | SSO Perusahaan |
| Verifies user identity? | Bukan dengan sendirinya | Ya | Ya |
| Common scenario | Penyatuan kalendar | Daftar masuk dengan Google | Corporate application login |
OAuth primarily answers, “What can this application access?” OIDC answers, “Who is the user?”
Menurut OpenID Connect Core specification, OIDC adds an authentication layer to OAuth 2.0 through ID tokens.
This distinction matters because developers should not treat an OAuth access token alone as proof of user authentication.
What are the benefits and use cases of OAuth?
OAuth supports secure application integrations across consumer and enterprise environments.
Manfaat utamanya termasuk:
- Reduced password exposure: Third-party applications do not need users’ account passwords.
- Limited permissions: Applications can request specific access scopes instead of unrestricted access.
- Simpler integrations: APIs can support external services through standardized authorization flows.
- Revocable authorization: Users and administrators can withdraw application permissions when necessary.
Common use cases include connecting collaboration tools to calendars, integrating CRM systems with business applications, enabling mobile apps to access cloud APIs, and authorizing automated services.
Is OAuth secure? Best practices for IT administrators
OAuth can provide strong authorization security, but its protection depends on correct implementation and permission management.
. IETF’s OAuth 2.0 Security Best Current Practice (RFC 9700) recommends several safeguards.
- Use PKCE: Require PKCE for public clients and use it for confidential clients wherever applicable.
- Gunakan keistimewaan terkecil: Request only the scopes necessary for an application’s functions.
- Protect tokens: Use HTTPS, secure token storage, and appropriate token lifetimes.
- Validate redirect URIs: Enforce exact redirect URI matching to reduce authorization-code leakage.
- Avoid deprecated flows: Do not introduce Implicit or Password grants into new applications.
- Semak kebenaran: Remove unnecessary third-party integrations and investigate suspicious consent requests.
OAuth 2.1 is also being developed to consolidate OAuth 2.0 and modern security practices. As of November 2026, it remains an Internet-Draft rather than a finalized RFC.
How can IT admins manage OAuth access in an organization?
IT administrators can manage OAuth-related risks by reviewing which applications can access organizational resources and what permissions they receive.
A practical governance process includes identifying connected applications, reviewing requested scopes, restricting unauthorized applications, and removing access that is no longer needed.
For example, Google Workspace administrators can use Google’s application access controls to review third-party applications and manage their access to organizational data.
In enterprise IAM environments, administrators should also establish consent policies and periodically audit privileged integrations. Revoking an application’s authorization may not immediately invalidate every previously issued access token, so token expiration and revocation behavior must be considered.
Kesimpulan
OAuth provides a standardized way for applications to access protected resources without sharing user passwords. By combining scoped permissions, secure token handling, modern authorization flows, and effective IAM governance, organizations can support application integrations while reducing unnecessary access risks.
Langkah Seterusnya
Soalan Lazim
1. Is OAuth an authentication or authorization protocol?
OAuth is an authorization framework, not an authentication protocol. It allows applications to access protected resources with appropriate permissions. OAuth does not independently verify a user’s identity for a client application. OpenID Connect adds authentication capabilities on top of OAuth 2.0.
2. What is the difference between OAuth 1.0 and OAuth 2.0?
OAuth 2.0 is a redesigned authorization framework that supports a wider range of applications and authorization flows. Unlike OAuth 1.0, OAuth 2.0 commonly relies on TLS-protected communication and bearer access tokens. The two versions are not backward-compatible.
3. Apakah perbezaan antara OAuth dan JWT?
OAuth is an authorization framework, whereas JSON Web Token (JWT) is a token format. OAuth defines how applications obtain authorization to access resources. JWT provides a structured way to represent claims and may be used as an OAuth access token, although OAuth does not require JWT.
4. Can OAuth be used for single sign-on?
OAuth 2.0 alone is not a complete single sign-on authentication solution. However, OpenID Connect builds on OAuth 2.0 to enable user authentication and SSO. Many modern identity providers combine these standards to support secure application login and API authorization.


