WIP oauth2-upgrade: oauth2 upgrade and REST fixes

OK @lnielsen-cern! I' ll fix it!