Implementation of OAuth with REST API