If you start with the action of Maxwell theory in four dimensions [I will denote by lowercase letters dynamical gauge fields and by uppercase, background gauge fields]
$$S[a] = \frac{1}{2}\int f\wedge\star f = \frac{1}{2}\int \mathrm{d}a\wedge\star\mathrm{d}a. \label{1}\tag{1}$$
This has a $\mathrm{U}(1)_\mathrm{e}^{[1]}$ one-form symmetry, dubbed "electric". We can see this because the transformation $a\mapsto a+\lambda$, where $\mathrm{d}\lambda=0$ leaves (\ref{1}) invariant.
You can turn on a 2-form background gauge field, $B$, for the electric one-form symmetry $\mathrm{U}(1)^{[1]}_\mathrm{e}$ similarly as you would for the $\mathrm{U}(1)$ of a compact scalar field, just this time everything is one form-degree higher. So
$$S[a,B] = \frac{1}{2}\int (\mathrm{d}a-B)\wedge\star(\mathrm{d}a - B),$$
now the equivalent of (background) gauging the symmetry is to allow for the shift of $a\mapsto a+\lambda$, to have some curvature, i.e. $\mathrm{d}\lambda\neq0$, as long as you compensate for that by a one-form gauge transformation of $B$; $B\mapsto B+\mathrm{d}\lambda$. Now, to find the current you can simply vary the action with respect to $B$, as you would in a textbook QFT and you find
$$J_\mathrm{e} := \frac{\delta S}{\delta B}\Bigg\vert_{B=0} = \star f.$$
I suppose that this answers your question, but since we came so far let's take it a little further.
You can also turn on a 2-form background field, $C$, for the magnetic one form symmetry $\mathrm{U}(1)^{[1]}_\mathrm{m}$, by adding a term like
$$\int C\wedge (\mathrm{d}a-B)$$
to the action. You similarly find a magnetic 2-form current
$$J_\mathrm{m} := \frac{\delta S}{\delta C}\Bigg\vert_{C=0} = f -B.$$
Without any work a mixed 't Hooft anomaly appeared, for non-zero $B$!
$$\mathrm{d}\star J_\mathrm{m} \sim \mathrm{d}\star B \neq 0.$$
And this is where all the fun starts...