Kong/insomnia · error · Error
invalid auth type
Error message
invalid auth type ${options.type} What it means
Constructor guard for the scripting-environment RequestAuth class: options.type is not one of the recognized authentication types (noauth, basic, bearer, jwt, digest, oauth1, oauth2, hawk, awsv4, ntlm, apikey, edgegrid, asap). The invalid type value is interpolated in the message.
Solutions
- Use a supported type: noauth, basic, bearer, jwt, digest, oauth1, oauth2, hawk, awsv4, ntlm, apikey, edgegrid, asap, netrc
- Check for typos in the type string in the script/request definition
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:267 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/5e555008d20e812e.
Report an issue: GitHub.
Appendix: source
Thrown at packages/insomnia-scripting-environment/src/objects/auth.ts:267
return optsVarLists;
} else if ('length' in options) {
// array
return [new VariableList(undefined, options)];
}
throw new Error('options is not valid: it must be VariableList<Variable> | Variable[] | object');
}
export class RequestAuth extends Property {
private type: AuthOptionTypes;
private authOptions = new Map<string, VariableList<Variable>>();
constructor(options: AuthOptions, parent?: Property) {
super();
if (!RequestAuth.isValidType(options.type)) {
throw new Error(`invalid auth type ${options.type}`);
}
this.type = options.type;
const optsObj = options as AuthOptions;
const optsEntries = Object.entries(optsObj).filter(optsObjEntry => optsObjEntry[0] !== 'type');
optsEntries
.map((optsEntry: [string, AuthOption[]]) => {
const optVars = optsEntry[1].map(opt => {
return new Variable({
key: opt.key,
value: opt.value,
type: opt.type,
});
});
return {
type: optsEntry[0],View on GitHub (pinned to d9bb2b0142)