{"record":{"id":"b902e266bc628250","repo":"Kong/insomnia","slug":"auth-transforming-fromprerequestauth-unknown-aut","errorCode":null,"errorMessage":"auth transforming(fromPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}","messagePattern":"auth transforming\\(fromPreRequestAuth\\): unknown auth grant type for oauth2: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia-scripting-environment/src/objects/auth.ts","lineNumber":502,"sourceCode":"        switch (inputGrantType) {\n          case 'authorization_code':\n          case 'authorization_code_with_pkce': {\n            return 'authorization_code';\n          }\n          case 'implicit': {\n            return 'implicit';\n          }\n          case 'password_credentials': {\n            return 'password';\n          }\n          case 'client_credentials': {\n            return 'client_credentials';\n          }\n          case 'refresh_token': {\n            return 'refresh_token';\n          }\n          default: {\n            throw new Error(\n              `auth transforming(fromPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}`,\n            );\n          }\n        }\n      })();\n\n      const responseType = ((): OAuth2ResponseType => {\n        const inputResponseType = findValueInOauth2Options('response_type', authObj.oauth2);\n        // responseType is currently always set to '' in our request auth model, this should be investigated what is correct to be set\n        if (['code', 'id_token', 'id_token token', 'none', 'token', ''].includes(inputResponseType)) {\n          return inputResponseType as OAuth2ResponseType;\n        }\n        throw new Error(\n          `unknown response type for oauth2: \"${inputResponseType}\", it could be: 'code' | 'id_token' | 'id_token token' | 'none' | 'token' | ''`,\n        );\n      })();\n\n      return {","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-scripting-environment/src/objects/auth.ts#L484-L520","documentation":"Error \"auth transforming(fromPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}