Added support for OAuth 2 for devices