{"record":{"id":"c7cb0fa601a885d5","repo":"kgretzky/evilginx2","slug":"auth-tokens-name-not-found-for-http-auth-token","errorCode":null,"errorMessage":"auth_tokens: 'name' not found for http auth token","messagePattern":"auth_tokens: 'name' not found for http auth token","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":571,"sourceCode":"\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'name' not found for body auth token\")\n\t\t\t}\n\t\t\tif at.Search == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'search' not found for body auth token\")\n\t\t\t}\n\n\t\t\terr := p.addBodyAuthToken(p.paramVal(*at.Domain), p.paramVal(*at.Path), p.paramVal(*at.Name), p.paramVal(*at.Search))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase \"http\":\n\t\t\tif at.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'domain' not found for http auth token\")\n\t\t\t}\n\t\t\tif at.Path == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'path' not found for http auth token\")\n\t\t\t}\n\t\t\tif at.Name == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'name' not found for http auth token\")\n\t\t\t}\n\t\t\tif at.Header == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'header' not found for http auth token\")\n\t\t\t}\n\n\t\t\terr := p.addHttpAuthToken(p.paramVal(*at.Domain), p.paramVal(*at.Path), p.paramVal(*at.Name), p.paramVal(*at.Header))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tfor _, au := range fp.AuthUrls {\n\t\tre, err := regexp.Compile(p.paramVal(au))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.authUrls = append(p.authUrls, re)\n\t}","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L553-L589","documentation":"Thrown during phishlet validation when an auth_tokens entry with type 'http' has no 'name' field. 'name' identifies the token so it can be tracked and re-injected; without it the phishlet cannot load.","triggerScenarios":"An http auth_tokens entry in the phishlet YAML sets domain/path/header but omits 'name', or 'name' is misspelled or attached to the wrong list item due to indentation.","commonSituations":"Forgetting the identifier when writing header-token configs; confusing 'name' (internal token id) with 'header' (actual HTTP header); YAML copy-paste dropping a line.","solutions":["Add a 'name:' field (arbitrary unique token identifier) to the http auth_tokens entry","Ensure 'name' and 'header' are both present and correctly indented","Validate the phishlet with the CLI before deploying"],"exampleFix":"// before\n  - type: http\n    domain: '.example.com'\n    path: '/'\n    header: X-Session\n// after\n  - type: http\n    domain: '.example.com'\n    path: '/'\n    name: session_token\n    header: X-Session","handlingStrategy":"validation","validationCode":"for i, at := range cfg.AuthTokens {\n  if at.Type == \"http\" && (at.Name == nil || *at.Name == \"\") {\n    return fmt.Errorf(\"auth_tokens[%d]: http token missing 'name'\", i)\n  }\n}","typeGuard":"func hasName(at AuthToken) bool { return at.Name != nil && *at.Name != \"\" }","tryCatchPattern":null,"preventionTips":["Give each token a unique, descriptive name distinct from the header field","Keep name and header adjacent in the YAML to avoid dropping one","Run phishlet validation after every edit"],"tags":["phishlet","config","yaml","validation"],"backgroundTag":"phishlet-schema-validation","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}