Added the code for OAuth2