The president lauded Kamala Harris and gave a forceful defence of his own achievements in a speech that he never wanted to give.