{"record":{"id":"9440a7d9bc811ca2","repo":"AlistGo/alist","slug":"authn-not-support","errorCode":null,"errorMessage":"authn not support","messagePattern":"authn not support","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/cloudreve_v4/util.go","lineNumber":99,"sourceCode":"\t\t\treturn err\n\t\t}\n\t\terr = json.Unmarshal(marshal, out)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (d *CloudreveV4) login() error {\n\tvar siteConfig SiteLoginConfigResp\n\terr := d.request(http.MethodGet, \"/site/config/login\", nil, &siteConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !siteConfig.Authn {\n\t\treturn errors.New(\"authn not support\")\n\t}\n\tvar prepareLogin PrepareLoginResp\n\terr = d.request(http.MethodGet, \"/session/prepare?email=\"+d.Addition.Username, nil, &prepareLogin)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !prepareLogin.PasswordEnabled {\n\t\treturn errors.New(\"password not enabled\")\n\t}\n\tif prepareLogin.WebauthnEnabled {\n\t\treturn errors.New(\"webauthn not support\")\n\t}\n\tfor range 5 {\n\t\terr = d.doLogin(siteConfig.LoginCaptcha)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.Error() != \"CAPTCHA not match.\" {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/cloudreve_v4/util.go#L81-L117","documentation":"During CloudreveV4 login, GET /site/config/login succeeded but the response indicates the site's Authn (API/token authentication) is disabled. Without authn the driver cannot perform programmatic email/password login, so it refuses immediately.","triggerScenarios":"d.login() reads siteConfig.Authn == false. Produced when the Cloudrebve V4 instance has authn/webauthn-style authentication turned off in its settings, so only the web login flow exists.","commonSituations":"Fresh V4 deployment with default auth settings; admin disabled authn for security; site relies exclusively on WebAuthn/passkeys or OIDC.","solutions":["Enable Authn in Cloudrebve V4 admin settings so email/password API login is permitted.","If authn cannot be enabled, mount this storage with a different mechanism or use a site that allows it.","Verify with curl that /api/v4/site/config/login really reports authn:false (rule out response-shape drift).","Update both server and driver to matching V4 versions."],"exampleFix":"curl -sS https://v4.example.com/api/v4/site/config/login\n# {\"code\":0,\"data\":{\"authn\":false,...}}  -> enable authn in admin panel, then re-save storage","handlingStrategy":"validation","validationCode":"// preflight before enabling a V4 storage\nvar cfg SiteLoginConfigResp\nif err := d.request(http.MethodGet, \"/site/config/login\", nil, &cfg); err != nil { return err }\nif !cfg.Authn { return errors.New(\"authn not support — enable Authn in Cloudreve V4 admin first\") }","typeGuard":"func siteSupportsAuthn(cfg SiteLoginConfigResp) bool { return cfg.Authn }","tryCatchPattern":"if err := d.login(); err != nil {\n    if err.Error() == \"authn not support\" {\n        return fmt.Errorf(\"cannot mount %s: enable Authn in Cloudreve V4 settings\", d.Addition.Site)\n    }\n    return err\n}","preventionTips":["Check /site/config/login.authn before configuring the driver","Do not use passkey-only or SSO-only sites with this driver","Surface config requirements in storage documentation"],"tags":["cloudreve-v4","login","authentication","configuration","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}