What is OAuth 2.0 and how does it connect applications without sharing passwords?

Published on 2026-10-20 by frfrand

OAuth 2.0 explained with an example of delegated permissions, scopes, redirects, and differences between authorization and identity.

What is OAuth 2.0 and how does it connect applications without sharing passwords?

Short answer: OAuth 2.0 is a framework for granting limited access to an application without handing over your account password for another service. The application redirects you to the provider, you approve the permissions (scopes), and it receives a scoped and revocable token. To identify a person, OpenID Connect is used, which relies on OAuth.

That's why it appears when you want to link a calendar, storage, or external system with a tool you use.

It's not just a "Sign in with Google" button. OAuth flows also exist for authorizing access to APIs.

The valet example

Imagine you leave your car at a parking lot. Instead of giving all your house keys to the staff, you hand over a key that works for a specific function.

OAuth seeks a similar goal: authorizing specific operations within a certain scope and conditions, without sharing the main password with the application requesting access.

The comparison is imperfect, because tokens can be copied if they leak, and each provider sets its own rules.

How it usually works

An application wants to check your calendar. It redirects you to the service that manages the account. There, you log in if necessary and review what access is being requested.

If you authorize it, the application can receive an authorization code and exchange it securely for access credentials according to the implemented flow. The obtained token allows calling an API within the granted permissions.

In the modern authorization code flow, PKCE is commonly used, which adds important protection, especially for public clients.

What is a scope?

A scope indicates an authorization scope defined by the service. For example, an integration may request to read calendar events instead of requesting access to all resources.

Requesting fewer permissions is a good practice. It makes no sense to request file deletion capability when the integration only needs to list names.

But scopes do not replace all API security checks. Each provider must also validate what real resources the holder can consult.

OAuth is not the same as OpenID Connect

A common confusion appears here. OAuth focuses on delegated authorization. OpenID Connect uses OAuth 2.0 as a base and adds an identity layer so that an application can authenticate the user.

That is why it is not advisable to take an access token from any service and use it as if it by itself demonstrated a person's identity to your application.

What risks exist?

A poorly validated redirect URL can allow sending codes to an unintended destination. A stolen token can be used within its scope while it remains valid. Requesting excessive permissions increases the impact of a compromise.

Modern implementations need to protect state when appropriate, use PKCE in the appropriate flows, validate redirects, and store tokens securely. It is not enough to copy a URL from a tutorial.

What about the refresh token?

Some providers deliver credentials that allow obtaining new access tokens without repeating the entire interaction. Not all flows use them nor have the same policies.

They must be protected especially: if someone obtains a valid refresh token, they can prolong access according to the provider's rules. It is advisable to check revocation, rotation, and expiration.

A real use case

Imagine an assistant that helps organize meetings and needs to check your availability. With a correct OAuth flow, you can authorize access to your calendar without giving the assistant your main password.

If you later stop using that application, you should be able to revoke access from the provider's account when it allows it.

What does it have to do with ArduMaker?

ArduMaker uses OAuth in two places. To log in or link your GitHub account, it redirects you to GitHub, which shows you the requested permissions (read:user, user:email and repo) and returns with a code that the server exchanges. And AI agents connect to ArduMaker's MCP with OAuth 2.1 and PKCE, with dynamic client registration: when authorizing, you choose whether the agent will have read-only access and which projects and VPSs it can reach.

In your own integrations, the same applies: grant only the necessary capabilities, with explicit and revocable authorization.

In one sentence: OAuth allows delegating scoped access. It does not eliminate the need to protect tokens nor replace a well-designed permissions policy.

Frequently asked questions

Does OAuth serve for logging in? Not by itself: OAuth delegates access to an API. "Log in with..." uses OpenID Connect, which adds an identity token over OAuth 2.0.

What is PKCE? A protection for the authorization code flow: the application generates a temporary secret and only whoever has it can exchange the code. It prevents an intercepted code from being used to obtain tokens, and today it is recommended for all types of clients.

How do I remove access to an application? From the security settings or connected applications of your account at the provider, which revokes its tokens.

Sources: RFC 6749, OAuth 2.0 · RFC 7636, PKCE · OpenID Connect.

What is OAuth 2.0 and how does it connect applications without sharing passwords?
  • OAuth
  • API
  • seguridad

Keep reading

All articles · VPS plans