Obama leads a nation often at odds with its allies.