In Appendix A of the paper, "Generalized Global Symmetries" by Gaiotto et al., they have considered an action, which for the purpose of the question, can be taken to be
$$S=\frac{n}{2\pi}\int B dA$$
where $B$ is a periodic scalar and $A$ is a $d-1$ form. Then they went on to construct the operators
$$U=e^{i\oint A} \ \ \ and \ \ \ V=e^{iB}$$
They claim that from the equation of motion, it follows that $U^n=1$ and $V^n=1$. I do not quite understand why this is so. The equations of motions are $dA=0$ and $dB=0$, which says that $B$ is a constant and $A$ is locally a pure gauge. Why should $B$ equal to $2\pi/n$? Why should,
$$\oint A \ \ \ be \ equal \ to \ \ \ 2\pi/n \ ?$$
Naively, it seems that $B$ can be some arbitrary constant, and for example, if we take the space to be two dimensional, $\oint A$ should be equal to $2\pi Z$ for non-contractible loops. It seems that we need some additional considerations, other than just EOM to obtain the result they quote.