Backport OAuth from 1.6.4 to 1.6.2.