From the reign of al-Mansur...
From the reign of al-Mansur, in the early stages of their rule, the 'Abbasids had faced the problem of legitimacy with the policy of suppressing the 'Alids by measures unheard of in history. They also employed legal notions to bear upon the political question, such as: 'right' (haqq), 'inheritance' (irth), 'kinship' (qarabah), and priority of paternal cousins over daughter's sons.
Jurisprudence ( fiqh ), speculation, literature and theology were all used in this political battle, and some heretical theological sects emerged which put forward certain concepts and expressions that were employed in it. However, bitter experience had proved that these repressive measures not only failed, but further nourished the propagation and continuance of revolutionary trends which rejected the 'Abbasid regime.
Al-Ma'mun realized the futility of this method in facing the problem caused by the principle of nass . He realized that he could deal successfully with the problem arising from the struggle of factions among the 'Abbasids and the struggle of the major powers in the regime through political and military means. However, he could not deal with the first problem - that of the nass - with the same measures, since it was of a different nature and would not yield to such measures.
Political measures would not be of any use, and military measures would only aggravate the problem. The 'Abbasids were very aware of the ineffectiveness of political measures in this kind of predicament and of the counter-productive effects of military measures. It was enough to recall how the Umayyads dealt with the problem of Khurasan at the beginning of the 'Abbasid revolution, in order to learn a lesson from it. Al-Ma'mun confronted both the problems together.
He continued to deal with the second problem using the customary military and political methods, but he faced the first fundamental issue of legitimacy through an understanding of the nature and method of its treatment. Al-Ma'mun realized that this problem had to be dealt with in a way that was in keeping with its nature. An ideological problem had political effects, so it was not reasonable to treat the effects without treating their cause. The appropriate method should also be ideological.
Thus, he conceived the idea of an ideological solution for the ideological problem, and that was to make al-'Imam 'Ali ibn Musa ibn Ja'far (A), called al-Rida, the heir apparent.