Implemented oauth2 service to handle redirect