AlistGo/alist · error

authn not support

Error message

authn not support

What it means

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.

Source

Thrown at drivers/cloudreve_v4/util.go:99

			return err
		}
		err = json.Unmarshal(marshal, out)
		if err != nil {
			return err
		}
	}

	return nil
}

func (d *CloudreveV4) login() error {
	var siteConfig SiteLoginConfigResp
	err := d.request(http.MethodGet, "/site/config/login", nil, &siteConfig)
	if err != nil {
		return err
	}
	if !siteConfig.Authn {
		return errors.New("authn not support")
	}
	var prepareLogin PrepareLoginResp
	err = d.request(http.MethodGet, "/session/prepare?email="+d.Addition.Username, nil, &prepareLogin)
	if err != nil {
		return err
	}
	if !prepareLogin.PasswordEnabled {
		return errors.New("password not enabled")
	}
	if prepareLogin.WebauthnEnabled {
		return errors.New("webauthn not support")
	}
	for range 5 {
		err = d.doLogin(siteConfig.LoginCaptcha)
		if err == nil {
			break
		}
		if err.Error() != "CAPTCHA not match." {

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Enable Authn in Cloudrebve V4 admin settings so email/password API login is permitted.
  2. If authn cannot be enabled, mount this storage with a different mechanism or use a site that allows it.
  3. Verify with curl that /api/v4/site/config/login really reports authn:false (rule out response-shape drift).
  4. Update both server and driver to matching V4 versions.

Example fix

curl -sS https://v4.example.com/api/v4/site/config/login
# {"code":0,"data":{"authn":false,...}}  -> enable authn in admin panel, then re-save storage
Defensive patterns

Strategy: validation

Validate before calling

// preflight before enabling a V4 storage
var cfg SiteLoginConfigResp
if err := d.request(http.MethodGet, "/site/config/login", nil, &cfg); err != nil { return err }
if !cfg.Authn { return errors.New("authn not support — enable Authn in Cloudreve V4 admin first") }

Type guard

func siteSupportsAuthn(cfg SiteLoginConfigResp) bool { return cfg.Authn }

Try / catch

if err := d.login(); err != nil {
    if err.Error() == "authn not support" {
        return fmt.Errorf("cannot mount %s: enable Authn in Cloudreve V4 settings", d.Addition.Site)
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: Fresh V4 deployment with default auth settings; admin disabled authn for security; site relies exclusively on WebAuthn/passkeys or OIDC.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/9440a7d9bc811ca2. Report an issue: GitHub.