{"record":{"id":"5d03cf9786f18032","repo":"micro/go-micro","slug":"unsupported-auth-s","errorCode":null,"errorMessage":"unsupported auth: %s","messagePattern":"unsupported auth: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cmd.go","lineNumber":481,"sourceCode":"\n\tif len(ctx.String(\"auth_id\")) > 0 || len(ctx.String(\"auth_secret\")) > 0 {\n\t\tauthOpts = append(authOpts, auth.Credentials(\n\t\t\tctx.String(\"auth_id\"), ctx.String(\"auth_secret\"),\n\t\t))\n\t}\n\tif len(ctx.String(\"auth_public_key\")) > 0 {\n\t\tauthOpts = append(authOpts, auth.PublicKey(ctx.String(\"auth_public_key\")))\n\t}\n\tif len(ctx.String(\"auth_private_key\")) > 0 {\n\t\tauthOpts = append(authOpts, auth.PrivateKey(ctx.String(\"auth_private_key\")))\n\t}\n\tif len(ctx.String(\"auth_namespace\")) > 0 {\n\t\tauthOpts = append(authOpts, auth.Namespace(ctx.String(\"auth_namespace\")))\n\t}\n\tif name := ctx.String(\"auth\"); len(name) > 0 {\n\t\tr, ok := c.opts.Auths[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unsupported auth: %s\", name)\n\t\t}\n\n\t\t*c.opts.Auth = r(authOpts...)\n\t}\n\n\t// Set the registry\n\tif name := ctx.String(\"registry\"); len(name) > 0 && (*c.opts.Registry).String() != name {\n\t\tr, ok := c.opts.Registries[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"registry %q is not linked into this binary: import go-micro.dev/v6/cmd/defaults to enable flag-selected plugins\", name)\n\t\t}\n\n\t\tsopts, clopts := c.setRegistry(r())\n\t\tserverOpts = append(serverOpts, sopts...)\n\t\tclientOpts = append(clientOpts, clopts...)\n\t}\n\n\t// Set the debug profile","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/cmd/cmd.go#L463-L499","documentation":"The CLI rejects a --auth value with no matching entry in c.opts.Auths, the map of auth providers registered by imported plugin packages. The Before hook returns the error and the command exits without running.","triggerScenarios":"Passing --auth jwt (or aws, oauth2, etc.) when the corresponding auth provider package was never imported into the binary, or the provider key is misspelled.","commonSituations":"Following service auth examples without linking the auth plugin; a stripped/minimal micro build; moving from the default no-op auth to a provider and forgetting the import.","solutions":["Check the provider name spelling against the registered plugin key.","Import the auth plugin package (e.g. _ \"go-micro.dev/v6/plugins/auth/jwt\") or go-micro.dev/v6/cmd/defaults and rebuild.","Omit --auth to use the default auth implementation.","Set --auth_namespace and related flags only after the provider is linked."],"exampleFix":"// before\nmicro --auth jwt new helloworld\n// after: main.go\nimport _ \"go-micro.dev/v6/plugins/auth/jwt\"\n// then:\nmicro --auth jwt new helloworld","handlingStrategy":"validation","validationCode":"allowedAuth := map[string]bool{\"\": true, \"jwt\": true /* linked providers */}\nif !allowedAuth[*authFlag] {\n    return fmt.Errorf(\"auth provider %q not linked into this binary\", *authFlag)\n}","typeGuard":null,"tryCatchPattern":"if err := c.Run(ctx); err != nil {\n    if strings.HasPrefix(err.Error(), \"unsupported auth:\") {\n        return fmt.Errorf(\"%w (import the auth plugin, e.g. plugins/auth/jwt)\", err)\n    }\n    return err\n}","preventionTips":["Match --auth values to auth plugin packages actually imported in main.go.","Keep auth provider name strings in version-controlled config, reviewed with the build.","After upgrades, confirm plugin registered names haven't changed."],"tags":["cli","auth","plugin-registration"],"backgroundTag":"plugin-not-linked","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}