This question deals with one of the issues which were fabricated to adjust a political agenda to justify the conspiracy of Saqeefah which was a big blunder immediately after the demise of the Prophet Muhammad (SAWA). Even Omar ibn al-Khattab who was the partner of Abu Bakr in Saqeefah called the allegiance to Abu Bakr as a dangerous blunder from its evil Allah Has protected the Muslims, and any one tries to do like it must be killed. ( Saheeh al- Bukhari , Hadeeth 6830, and Musnad Ahmad ibn Hanbal; 7:431 Hadeeth 37031 and 37032).
It is a well known fact that Imam Ali (AS) rejected the outcome of Saqeefah and refused to give allegiance to Abu Bakr. ( Saheeh al-Bukhari and Saheeh Muslim). Some narrations in Sunni books claim that imam Ali (AS) has given allegiance to Abu Bakr after six months. Such narrations are fabricated politically oriented. Imam Ali (AS) has never given allegiance to Abu Bakr despite the tremendous pressure and threatening which he faced from the group of Saqeefah which reached to burning the house on him and his wife Fatimah and all his family if he refuses to give allegiance to Abu Bakr. ( Musannaf ibn Abi Shaibah;Hadeeth 36383, and Tareekh al-Tabari;V.2, P. 443, and Ansaari al-Ashraf by al-Balathuri; V.1, P.586 and al-Soyooti in Musnad Fatimah, page 36, and Ibn Qutaiba al-Dinori in Al-Imamah wal Siyaasah , V.1, P.19.and many other Sunni books.
Al-Shaikh al-Mufeed refuted the claim of the opponents that Imam Ali (AS) gave allegiance to Abu Bakr saying: The refusal of Imam Ali to give allegiance to Abu Bakr is undisputed fact among all the scholars, while the claim that he gave allegiance is disputed. His refusal was based on his responsibility to refuse wrong, and this responsibility remained with him always and there is no evidence that wrong has turned to be right. Al-Shaikh Al-Mufeed and our authentic great Ulama has stated that Imam Ali has never given allegiance to Abu Bakr. Obviously, the real leader of all the Faithful can never be a follower of Saqeefah imposed rulers.
Well known Sunni scholar Al-Dhahabi has stated : Ali did not attend any Friday prayer nor congregational prayer with any of the three Caliphs. ( Siyar A'laam al-Nubalaa' 9: 284).