Kong/insomnia · error · Error
auth transforming(toPreRequestAuth): unknown auth grant…
Error message
auth transforming(toPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType} What it means
Default branch of the OAuth2 grant switch in toPreRequestAuth (reverse mapping): the internal grant 'password'-family value has no counterpart — specifically values other than authorization_code, implicit, password, client_credentials, refresh_token.
Solutions
- Use one of the five supported internal grant types
- Avoid custom grant values when constructing auth in scripts
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:701 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/8ac31d2b8d294573.
Report an issue: GitHub.
Appendix: source
Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:701
const grantType = (() => {
switch (inputGrantType) {
case 'authorization_code': {
return auth.usePkce ? 'authorization_code_with_pkce' : 'authorization_code';
}
case 'implicit': {
return 'implicit';
}
case 'password': {
return 'password_credentials';
}
case 'client_credentials': {
return 'client_credentials';
}
case 'refresh_token': {
return 'refresh_token';
}
default: {
throw new Error(
`auth transforming(toPreRequestAuth): unknown auth grant type for oauth2: ${inputGrantType}`,
);
}
}
})();
return {
type: 'oauth2',
oauth2: [
{ key: 'disabled', value: auth.disabled ? 'true' : 'false' },
{ key: 'grant_type', value: grantType },
{ key: 'authUrl', value: auth.authorizationUrl || '' },
{ key: 'accessTokenUrl', value: auth.accessTokenUrl || '' },
{ key: 'clientId', value: auth.clientId || '' },
{ key: 'clientSecret', value: auth.clientSecret || '' },
{ key: 'scope', value: auth.scope || '' },
View on GitHub (pinned to d9bb2b0142)