Add support for connecting to the rewrap and other endpoints with an OAuth2 bearer token, with related work to handle errors