We used to say in the prayer: 'AsSalam be on Allah, As-Salam be on so-and so.' So one day the Prophet said to us, "Allah Himself is As-Salam; when anyone of you sits during his prayer, he should say: 'at-tah, iyyatu-li l-lahi,' up to 'As-Salihin,' (All the compliments are for Allah ...righteous people) for when he recites this, then he says his Salam to all the righteous people present in the heavens and on the earth. Then he should say, 'I testify that none has the right to be worshipped except Allah, and that Muhammad is His slave and His Apostle,' and then he can select whatever he likes to celebrate (Allah's) Praises."
كُنَّا نَقُولُ فِي الصَّلاَةِ السَّلاَمُ عَلَى اللَّهِ السَّلاَمُ عَلَى فُلاَنٍ فَقَالَ لَنَا النَّبِيُّ ﷺ ذَاتَ يَوْمٍ إِنَّ اللَّهَ هُوَ السَّلاَمُ فَإِذَا قَعَدَ أَحَدُكُمْ فِي الصَّلاَةِ فَلْيَقُلِ التَّحِيَّاتُ لِلَّهِ إِلَى قَوْلِهِ الصَّالِحِينَ فَإِذَا قَالَهَا أَصَابَ كُلَّ عَبْدٍ لِلَّهِ فِي السَّمَاءِ وَالأَرْضِ صَالِحٍ أَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ ثُمَّ يَتَخَيَّرُ مِنَ الثَّنَاءِ مَا شَاءَ