Rework for oauth2 2.1.1.