Best glue for shower bar?
Assuming these bars are not used to support the load of a human pulling on them, the typical choice of adhesive in a shower is silicone. As an added benefit, while strong, it is removable by cutting and scraping.

Make sure that both surfaces are clean before gluing and that you have a way to apply pressure (clamping) to the two surfaces.  Painters tape might be an option depending on where they are going.