goharbor/harbor · error

failed to get oidc user info, error

Error message

failed to get oidc user info, error: %v

What it means

VerifySecret failed at its first step: the meta DAO lookup of the OIDC user record by username returned a database error (not a missing user — that is reported separately), so the stored OIDC secret could not be loaded for verification.

Solutions

  1. Check database connectivity from the core service
  2. Inspect core logs for the wrapped DAO error
  3. Verify the oidc_user table exists and is healthy
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/pkg/oidc/secret.go:91 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/bccec60578e63ab2. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/oidc/secret.go:91

}

var keyLoader = &keyGetter{}

type defaultManager struct {
	metaDao dao.MetaDAO
}

var m SecretManager = &defaultManager{
	metaDao: dao.NewMetaDao(),
}

// VerifySecret verifies the secret and the token associated with it, it refreshes the token in the DB if it's
// refreshed during the verification.  It returns a populated user model based on the ID token associated with the secret.
func (dm *defaultManager) VerifySecret(ctx context.Context, username string, secret string) (*UserInfo, error) {
	log.Debugf("Verifying the secret for user: %s", username)
	oidcUser, err := dm.metaDao.GetByUsername(ctx, username)
	if err != nil {
		return nil, fmt.Errorf("failed to get oidc user info, error: %v", err)
	}
	if oidcUser == nil {
		return nil, fmt.Errorf("user is not onboarded as OIDC user, username: %s", username)
	}
	key, err := keyLoader.encryptKey()
	if err != nil {
		return nil, fmt.Errorf("failed to load the key for encryption/decryption: %v", err)
	}
	plainSecret, err := utils.ReversibleDecrypt(oidcUser.Secret, key)
	if err != nil {
		return nil, fmt.Errorf("failed to decrypt secret from DB: %v", err)
	}
	if subtle.ConstantTimeCompare([]byte(secret), []byte(plainSecret)) != 1 {
		return nil, verifyError(fmt.Errorf("secret mismatch, username: %s", username))
	}
	tokenStr, err := utils.ReversibleDecrypt(oidcUser.Token, key)
	if err != nil {
		return nil, verifyError(err)

View on GitHub (pinned to 7b2fd08cc5)