We prove a general criterion for the uniqueness of critical points of a functional in the presence of constraints such as positivity, boundedness, or fixed mass. Our method relies on convexity properties along suitable paths and significantly generalizes well-known uniqueness theorems. Due to the flexibility in the construction of the paths, our approach does not depend on the convexity of the domain and can be used to prove the uniqueness in subsets, even if it does not hold globally. The results apply to all critical points and not only to minimizers, providing the uniqueness of solutions to the corresponding Euler-Lagrange equations. For functionals emerging from elliptic problems, the assumptions of our abstract theorems follow from maximum principles, decay properties, and novel general inequalities. To illustrate our method we present a unified proof of known results, as well as new theorems for mean-curvature type operators, fractional Laplacians, Hamiltonian systems, Schrödinger equations, and Gross-Pitaevskii systems.