{"record":{"id":"8ac31d2b8d294573","repo":"Kong/insomnia","slug":"auth-transforming-toprerequestauth-unknown-auth","errorCode":null,"errorMessage":"auth transforming(toPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}","messagePattern":"auth transforming\\(toPreRequestAuth\\): unknown auth grant type for oauth2: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia-scripting-environment/src/objects/auth.ts","lineNumber":701,"sourceCode":"      const grantType = (() => {\n        switch (inputGrantType) {\n          case 'authorization_code': {\n            return auth.usePkce ? 'authorization_code_with_pkce' : 'authorization_code';\n          }\n          case 'implicit': {\n            return 'implicit';\n          }\n          case 'password': {\n            return 'password_credentials';\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(toPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}`,\n            );\n          }\n        }\n      })();\n\n      return {\n        type: 'oauth2',\n        oauth2: [\n          { key: 'disabled', value: auth.disabled ? 'true' : 'false' },\n\n          { key: 'grant_type', value: grantType },\n          { key: 'authUrl', value: auth.authorizationUrl || '' },\n          { key: 'accessTokenUrl', value: auth.accessTokenUrl || '' },\n          { key: 'clientId', value: auth.clientId || '' },\n          { key: 'clientSecret', value: auth.clientSecret || '' },\n          { key: 'scope', value: auth.scope || '' },\n","sourceCodeStart":683,"sourceCodeEnd":719,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-scripting-environment/src/objects/auth.ts#L683-L719","documentation":"Error \"auth transforming(toPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:701 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"}