In this work we present a novel method to address the balancing problem for torque controlled legged robots through post-optimization of contact forces. The main concept consists in treating a legged robot as a fully actuated fixed-base system in order to compute the desired joint torques according to [1]. The under-actuated component of the obtained torques is then be mapped into contact forces through an optimal distribution problem. Besides extending [1] to the floatingbase case, the proposed method has the notable advantage of avoiding the specification of a desired momentum of rotation, in addition to a reduced number of decision variables compared to full-inverse dynamics methods. The effectiveness of our approach has been validated in simulation using two different humanoid platforms: the CENTAURO and the COMAN+ robots, both recently developed at Istituto Italiano di Tecnologia (IIT). Preliminary experimental results on COMAN+ are also presented.