WIP oauth2-upgrade: oauth2 upgrade and REST fixes

I guess you can fit all arguments on single line.