goharbor/harbor · error

the auth mode %s does not support this flow

Error message

the auth mode %s does not support this flow

What it means

Error "the auth mode %s does not support this flow" thrown in goharbor/harbor.

Source

Thrown at src/core/controllers/authproxy_redirect.go:48

	postURIKey        = "postURI"
)

var helper = &authproxy.Auth{}

// AuthProxyController handles requests with token that can be reviewed by authproxy.
type AuthProxyController struct {
	api.BaseController
}

// Prepare checks the auth mode and fail early
func (apc *AuthProxyController) Prepare() {
	am, err := config.AuthMode(apc.Context())
	if err != nil {
		apc.SendInternalServerError(err)
		return
	}
	if am != common.HTTPAuth {
		apc.SendPreconditionFailedError(fmt.Errorf("the auth mode %s does not support this flow", am))
		return
	}
}

// HandleRedirect reviews the token and login the user based on the review status.
func (apc *AuthProxyController) HandleRedirect() {
	token := apc.Ctx.Request.URL.Query().Get(authproxyTokenKey)
	if token == "" {
		log.Errorf("No token found in request.")
		apc.Ctx.Redirect(http.StatusMovedPermanently, "/")
		return
	}
	u, err := helper.VerifyToken(apc.Context(), token)
	if err != nil {
		log.Errorf("Failed to verify token, error: %v", err)
		apc.Ctx.Redirect(http.StatusMovedPermanently, "/")
		return
	}

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/core/controllers/authproxy_redirect.go:48 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/061858485b5e8653. Report an issue: GitHub.