The temperature of the surface of the sun can be inferred from a study of the:
solar flares
solar spots
solar corona
solar spectrum
From the solar spectrum the wavelength of the star and hence the temperature of the star can be determined.