{"record":{"id":"9562a1572604ea9f","repo":"fatedier/frp","slug":"invalid-auth-method-optional-values-are-v","errorCode":null,"errorMessage":"invalid auth method, optional values are %v","messagePattern":"invalid auth method, optional values are (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/client.go","lineNumber":102,"sourceCode":"\t\t\trequirements.VirtualNet = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !requirements.VirtualNet {\n\t\tfor _, cfg := range visitorCfgs {\n\t\t\tif cfg.GetBaseConfig().Plugin.Type == v1.VisitorPluginVirtualNet {\n\t\t\t\trequirements.VirtualNet = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn requirements\n}\n\nfunc (v *ConfigValidator) validateAuthConfig(c *v1.AuthClientConfig) (Warning, error) {\n\tvar errs error\n\tif !slices.Contains(SupportedAuthMethods, c.Method) {\n\t\terrs = AppendError(errs, fmt.Errorf(\"invalid auth method, optional values are %v\", SupportedAuthMethods))\n\t}\n\tif !lo.Every(SupportedAuthAdditionalScopes, c.AdditionalScopes) {\n\t\terrs = AppendError(errs, fmt.Errorf(\"invalid auth additional scopes, optional values are %v\", SupportedAuthAdditionalScopes))\n\t}\n\n\terrs = AppendError(errs, v.validateAuthTokenSource(c.Token, c.TokenSource))\n\n\tif err := v.validateOIDCConfig(&c.OIDC); err != nil {\n\t\terrs = AppendError(errs, err)\n\t}\n\tif c.Method == v1.AuthMethodOIDC && c.OIDC.TokenSource == nil {\n\t\tif err := ValidateOIDCClientCredentialsConfig(&c.OIDC); err != nil {\n\t\t\terrs = AppendError(errs, err)\n\t\t}\n\t}\n\treturn nil, errs\n}\n","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/client.go#L84-L120","documentation":"The client auth.method value is not one of the supported methods. frp's validator checks auth.Method against SupportedAuthMethods (\"token\", \"oidc\", and the empty default) and fails fast with the allowed list embedded in the message. This runs in validateAuthConfig during full client config validation.","triggerScenarios":"c.Auth.Method is set to anything not in SupportedAuthMethods, e.g. \"ldap\", \"basic\", \"tokn\" (typo), or a deprecated value from an older frp version (older releases used \"token\" only or different casing).","commonSituations":"Typos in auth.method; migrating configs from frp versions whose accepted method names changed; attempting to use a plugin-based auth scheme as a top-level method.","solutions":["Set auth.method to a supported value — check the message's %v list, typically \"token\" or \"oidc\"","Remove auth.method entirely if you want the default (no auth)","Re-check for stray whitespace/case in the YAML/TOML value (\"Token\" vs \"token\")"],"exampleFix":"# before\n[auth]\nmethod = \"tokn\"\ntoken = \"x\"\n\n# after\n[auth]\nmethod = \"token\"\ntoken = \"x\"","handlingStrategy":"validation","validationCode":"func validAuthMethod(m v1.AuthMethod) bool {\n    return slices.Contains(validation.SupportedAuthMethods, m)\n}\n// use: if !validAuthMethod(cfg.Auth.Method) { /* fix before validate */ }","typeGuard":null,"tryCatchPattern":"if _, err := validation.ValidateClientCommonConfig(cfg); err != nil {\n    if strings.HasPrefix(err.Error(), \"invalid auth method\") {\n        cfg.Auth.Method = v1.AuthMethodToken // sane fallback, then re-validate\n    }\n}","preventionTips":["Pin auth.method values to constants from pkg/config/v1 instead of raw strings","Lint config files for known enum fields"],"tags":["frp","config","auth","validation","go"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}