Cálculo 100% en el Navegador • Cero Registros en Servidor • Ejecución Inmediata
Curious TechieCaja de Herramientas
Security & AuthenticationIETF RFC 6749 / RFC 7636 (PKCE) / OpenID Foundation✓ Tabla de Búsqueda Rápida (6 elementos) • ES

Referencia de Conceptos OAuth 2.0 y OpenID Connect

Flujos de Autorización, Tokens, Scopes y Especificación RFC 6749

CT
Curious-Techie Engineering TeamAutor Verificado

Web Protocols & Security Architecture Research

Publicado:
•
Actualizado:
•7 min read
Especificación Oficial:RFC 9110(IETF)
Revisado por Curious-Techie Architecture Peer Review Group

Visión General y Alcance

RFC 6749 y RFC 7636 (PKCE) establecen los flujos de concesión de acceso estándar para proteger clientes web, móviles y APIs empresariales.

Tabla de Especificaciones y Matriz

Filtro instantáneo por palabra clave, código o directiva

Clave / CódigoDefinición y DetallesJerarquía Semántica GEOEspecificación y Notas
Resource Owner
Resource Owner

An entity capable of granting access to a protected resource (typically the human end-user).

The human user logging into their account.
●Resource Owner
↳OAuth role
↳identity principal
↳end-user authorization authority
RFC 6749 §1.1

Owns the data stored on the Resource Server.

Resource Server
Resource Server

The server hosting protected resources, capable of accepting and responding to protected resource requests using access tokens.

https://api.example.com/v1/photos
●Resource Server
↳OAuth role
↳API backend
↳protected endpoint host
RFC 6749 §1.1

Validates access tokens before returning user data.

Authorization Server
Authorization Server

The server issuing access tokens to the client after successfully authenticating the resource owner and obtaining authorization.

https://accounts.google.com or Auth0
●Authorization Server
↳OAuth role
↳identity provider
↳token issuing authority
RFC 6749 §1.1

Presents the login consent screen to the user.

Authorization Code with PKCE
Authorization Code with PKCE

The gold-standard OAuth grant type for SPAs, mobile apps, and servers, preventing code interception attacks.

code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256
●PKCE
↳OAuth grant
↳authorization code flow
↳cryptographic proof-of-possession code exchange
RFC 7636

Mandatory for public clients (React, iOS, Android) that cannot securely hold client secrets.

Client Credentials
Client Credentials Grant

Grant type used for machine-to-machine (M2M) communication where the client is the resource owner.

grant_type=client_credentials&client_id=...&client_secret=...
●Client Credentials
↳OAuth grant
↳M2M authorization
↳backend service-to-service auth
RFC 6749 §4.4

No human user is involved; used by background microservices, daemons, and cron jobs.

Refresh Token
Refresh Token

A credential used to obtain a new access token when the current access token expires without user interaction.

grant_type=refresh_token&refresh_token=rT_8941a...
●Refresh Token
↳OAuth credential
↳token rotation
↳long-lived renewal credential
RFC 6749 §1.5

Long-lived; should be stored in secure HttpOnly cookies and rotated on every use.

Ejemplo Técnico y Código

PKCE Code Verifier & Challenge Generation (JavaScript)

javascriptCopiar Código
// 1. Generate random code_verifier string (43-128 chars)
const array = new Uint8Array(32);
crypto.getRandomValues(array);
const codeVerifier = btoa(String.fromCharCode(...array))
  .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');

// 2. Compute SHA-256 digest of code_verifier
const encoder = new TextEncoder();
const data = encoder.encode(codeVerifier);
const digest = await crypto.subtle.digest('SHA-256', data);

// 3. Base64URL encode digest to create code_challenge
const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest)))
  .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');

PKCE binds the authorization request to the token request, preventing malicious apps from intercepting authorization codes.

Preguntas Frecuentes

Preguntas y Respuestas sobre Estándares

What is the difference between OAuth 2.0 and OpenID Connect (OIDC)?↓
OAuth 2.0 is designed for AUTHORIZATION (granting access to APIs via Access Tokens). OpenID Connect adds an identity layer on top of OAuth 2.0 for AUTHENTICATION (proving who the user is via ID Tokens).
Authoritative Sourcing & Verification

References & Primary Sources

Every source below directly substantiates technical statements and protocol behaviors explained in Referencia de Conceptos OAuth 2.0 y OpenID Connect. Curious-Techie prioritizes official Internet standards (IETF RFCs, W3C Recommendations, WHATWG specifications) and established security bodies (OWASP, NIST). Zero sponsored or secondary links.

  1. [1]IETFPrimary SpecificationRFC 6749 • Section 1 & 4
    Verified Primary Source
    Technical Claim Supported:

    Specifies delegated authorization protocol flows, client registration, token issuance endpoints, and scoped resource access tokens.

  2. [2]IETFPrimary SpecificationRFC 7636 • Section 4 & 5
    Verified Primary Source
    Technical Claim Supported:

    Mandatory standard preventing authorization code injection and interception attacks in public clients (SPAs and mobile apps) using SHA-256 code verifiers.

  3. [3]IETFAuthoritative Security StandardRFC 6819 • Section 3
    Verified Primary Source
    Technical Claim Supported:

    Analyzes attack surfaces including redirect URI manipulation, token leakage, and CSRF attacks on authorization flows.