The abundance of 26Al carries a special role in astrophysics, since it probes active nucleosynthesis in the Milky Way and constrains the Galactic core-collapse supernovae rate. It is estimated through the detection of the 1809 keV γ-line and from the superabundance of 26Mg in comparison with the most abundant Mg isotope (A = 24) in meteorites. For this reason, high precision is necessary also in the investigation of the stable 27Al and 24Mg isotopes. Moreover, these nuclei enter the so-called MgAl cycle, playing an important role in the production of Al and Mg. Recently, high-resolution stellar surveys have shown that the Mg–Al anticorrelation in red-giant stars in globular clusters may hide the existence of multiple stellar populations, and that the relative abundances of Mg isotopes may not be correlated with Al. The common thread running through these astrophysical scenarios is the 27Al(p,α)24Mg reaction, which is the main 27Al destruction channel and directly correlates its abundance with the 24Mg one. Since available reaction rates show large uncertainties owing to the vanishingly small cross section at astrophysical energies, we have applied the Trojan Horse Method to deduce the reaction rate with no need of extrapolation. The indirect measurement made it possible to assess the contribution of the 84 keV resonance and to lower upper limits on the strength of nearby resonances. In intermediate-mass AGB stars experiencing hot bottom burning, a sizeable increase in surface aluminum abundance is observed at the lowest masses, while 24Mg is essentially unaffected by the change in the reaction rate.