Kong/insomnia · error · Error

auth transforming(fromPreRequestAuth): unknown auth grant ty

Error message

auth transforming(fromPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}

What it means

Error "auth transforming(fromPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:502

        switch (inputGrantType) {
          case 'authorization_code':
          case 'authorization_code_with_pkce': {
            return 'authorization_code';
          }
          case 'implicit': {
            return 'implicit';
          }
          case 'password_credentials': {
            return 'password';
          }
          case 'client_credentials': {
            return 'client_credentials';
          }
          case 'refresh_token': {
            return 'refresh_token';
          }
          default: {
            throw new Error(
              `auth transforming(fromPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}`,
            );
          }
        }
      })();

      const responseType = ((): OAuth2ResponseType => {
        const inputResponseType = findValueInOauth2Options('response_type', authObj.oauth2);
        // responseType is currently always set to '' in our request auth model, this should be investigated what is correct to be set
        if (['code', 'id_token', 'id_token token', 'none', 'token', ''].includes(inputResponseType)) {
          return inputResponseType as OAuth2ResponseType;
        }
        throw new Error(
          `unknown response type for oauth2: "${inputResponseType}", it could be: 'code' | 'id_token' | 'id_token token' | 'none' | 'token' | ''`,
        );
      })();

      return {

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:502 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/b902e266bc628250. Report an issue: GitHub.