Implemented OAuth authentication in the webapi.