chore(oauth): compatibility with OAuth PHP module

Was #6548

Rebased to 1.8