Kong/insomnia · error

No OAuth 2.0 access tokens found for request

Error message

No OAuth 2.0 access tokens found for request

What it means

Error "No OAuth 2.0 access tokens found for request" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia/src/common/templating/local-template-tags.ts:976

          if (request.headers.length === 0) {
            throw new Error('No headers available');
          }

          for (const header of request.headers) {
            const headerName = await context.util.render(header.name);
            headerName && headerNames.push(headerName);
            if (headerName?.toLowerCase() === name.toLowerCase()) {
              return context.util.render(header.value);
            }
          }

          const headerNamesStr = headerNames.map(n => `"${n}"`).join(',\n\t');
          throw new Error(`No header with name "${name}".\nChoices are [\n\t${headerNamesStr}\n]`);
        }
        if (attribute === 'oauth2' || attribute === 'oauth2-identity' || attribute === 'oauth2-refresh') {
          const access = await context.util.models.oAuth2Token.getByRequestId(request._id);
          if (!access || !access.accessToken) {
            throw new Error('No OAuth 2.0 access tokens found for request');
          }
          if (attribute === 'oauth2') {
            return access.accessToken;
          }
          if (attribute === 'oauth2-identity') {
            return access.identityToken;
          }
          if (attribute === 'oauth2-refresh') {
            return access.refreshToken;
          }
        }
        if (attribute === 'name') {
          return request.name;
        }
        if (attribute === 'folder') {
          const ancestors = await context.util.models.request.getAncestors(request);
          const doc = ancestors[folderIndex || 0];
          if (!doc) {

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia/src/common/templating/local-template-tags.ts:976 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/152280502ee0cc53. Report an issue: GitHub.