  Starting from a constrained real $BF$-type action for general relativity that
includes both the Immirzi parameter and the cosmological constant, we obtain
the Ashtekar-Barbero variables used in the canonical approach to the
quantization of the gravitational field. This is accomplished by explicitly
solving the second-class constraints resulting from the Hamiltonian analysis of
the considered action, and later imposing the time gauge. All throughout this
work the tetrad formalism is left aside, obtaining the Ashtekar-Barbero
variables entirely in terms of the $B$-fields that define the action.
