Files
yaak-mountain-loop/plugins/auth-oauth2
Gregory Schier 0e14625e62 Hand the body back from send instead of holding it for a lookup
Holding an unsaved body against its response id let a plugin stash the id
and read it in a later call, which would throw only sometimes and only
for ad-hoc sends. Documenting that was never going to be enough.

send now returns the response and its body together, so there is nothing
to stash: an unsaved body is a value you were handed. ctx.httpResponse
.body() goes back to meaning one thing, a saved response read by id, and
refuses ids it has no row for. Reading is identical either way, so no
caller has to know which kind of send it made.
2026-08-16 10:07:44 -07:00
..
2025-07-19 21:47:19 -07:00

OAuth 2.0 Authentication

An OAuth 2.0 authentication plugin that supports multiple grant types and flows, enabling secure API authentication with OAuth 2.0 providers.

Screenshot of OAuth 2.0 auth UI

Overview

This plugin implements OAuth 2.0 authentication for requests, supporting the most common OAuth 2.0 grant types used in modern API integrations. It handles token management, automatic refresh, and PKCE (Proof Key for Code Exchange) for enhanced security.

Supported Grant Types

Authorization Code Flow

The most secure and commonly used OAuth 2.0 flow for web applications.

  • Standard Authorization Code flow
  • Optional PKCE (Proof Key for Code Exchange) for enhanced security
  • Supports automatic token refresh

Client Credentials Flow

Ideal for server-to-server authentication where no user interaction is required.

Implicit Flow

Legacy flow for single-page applications (deprecated but still supported):

  • Direct access token retrieval
  • No refresh token support
  • Suitable for legacy integrations

Resource Owner Password Credentials Flow

Direct username/password authentication.

  • User credentials are exchanged directly for tokens
  • Should only be used with trusted applications
  • Supports automatic token refresh

Features

  • Automatic Token Management: Handles token storage, expiration, and refresh automatically
  • PKCE Support: Enhanced security for Authorization Code flow
  • Token Persistence: Stores tokens between sessions
  • Flexible Configuration: Supports custom authorization and token endpoints
  • Scope Management: Configure required OAuth scopes for your API
  • Error Handling: Comprehensive error handling and user feedback

Usage

  1. Configure the request, folder, or workspace to use OAuth 2.0 Authentication
  2. Select the appropriate grant type for your use case
  3. Fill in the required OAuth 2.0 parameters from your API provider
  4. The plugin will handle the authentication flow and token management automatically

Compatibility

This plugin is compatible with OAuth 2.0 providers including:

  • Google APIs
  • Microsoft Graph
  • GitHub API
  • Auth0
  • Okta
  • And many other OAuth 2.0 compliant services