{"record":{"id":"bdbf9e0ad965ba31","repo":"kgretzky/evilginx2","slug":"auth-tokens-domain-not-found-for-cookie-auth-to","errorCode":null,"errorMessage":"auth_tokens: 'domain' not found for cookie auth token","messagePattern":"auth_tokens: 'domain' not found for cookie auth token","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":532,"sourceCode":"\t\t\t}\n\t\t\terr = p.addIntercept(*ic.Domain, path_re, *ic.HttpStatus, body, mime)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tfor _, at := range *fp.AuthTokens {\n\t\tttype := \"cookie\"\n\t\tif at.Type != nil {\n\t\t\tttype = *at.Type\n\t\t}\n\t\tif !stringExists(ttype, AUTH_TOKEN_TYPES) {\n\t\t\treturn fmt.Errorf(\"auth_tokens: invalid token type: %s\", ttype)\n\t\t}\n\t\tswitch ttype {\n\t\tcase \"cookie\":\n\t\t\tif at.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'domain' not found for cookie auth token\")\n\t\t\t}\n\t\t\tif at.Keys == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'keys' not found for cookie auth token\")\n\t\t\t}\n\n\t\t\tfor n := range *at.Keys {\n\t\t\t\t(*at.Keys)[n] = p.paramVal((*at.Keys)[n])\n\t\t\t}\n\t\t\terr := p.addCookieAuthTokens(p.paramVal(*at.Domain), *at.Keys)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase \"body\":\n\t\t\tif at.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'domain' not found for body 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 body auth token\")","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L514-L550","documentation":"This error is thrown when a `cookie`-type entry in a phishlet's `auth_tokens` section does not define the required `domain` field. Cookie auth tokens need a domain to scope the token to; without it the entry cannot be registered. The phishlet is rejected at load time.","triggerScenarios":"An auth_tokens entry with `type: cookie` (or no type, since cookie is the default) lists `keys:` but omits the `domain:` key entirely.","commonSituations":"Writing a minimal auth_tokens entry and forgetting domain; assuming domain is inherited from the phishlet host and skipping it; YAML indentation mistakes placing `domain` in the wrong entry.","solutions":["Add a `domain` field to the cookie auth token entry, matching a subdomain declared in the phishlet (e.g. `domain: accounts`).","If the token applies to all subdomains, check whether the format allows a wildcard domain and use it explicitly.","Verify YAML list indentation so `domain` belongs to the same auth_tokens item as the `keys` list."],"exampleFix":"// before (phishlet.yml)\nauth_tokens:\n  - keys: [auth_session]\n// after\nauth_tokens:\n  - type: cookie\n    domain: accounts\n    keys: [auth_session]","handlingStrategy":"validation","validationCode":"for i, at := range cfg.AuthTokens {\n    if at.Type != nil && *at.Type == \"cookie\" && at.Domain == nil {\n        return fmt.Errorf(\"auth_tokens[%d]: 'domain' not found for cookie auth token\", i)\n    }\n}","typeGuard":"func cookieTokenComplete(at AuthToken) bool {\n    return at.Domain != nil && at.Keys != nil && len(*at.Keys) > 0\n}","tryCatchPattern":null,"preventionTips":["Always pair cookie tokens with both `domain` and `keys`.","Check YAML list indentation so fields belong to the intended entry.","Lint phishlets with a schema that enforces per-type required fields."],"tags":["phishlet","configuration","auth-tokens","yaml-validation"],"backgroundTag":"missing-required-argument","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"}