#include "remoting/base/corp_auth_util.h"
#include "base/check.h"
#include "remoting/base/oauth_token_getter_impl.h"
namespace remoting {
namespace {
constexpr char kOAuthScope[] =
"https://www.googleapis.com/auth/chromoting.me2me.host";
}
std::unique_ptr<OAuthTokenGetterImpl> CreateCorpTokenGetter(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const std::string& service_account_email,
const std::string& refresh_token) {
DCHECK(url_loader_factory);
DCHECK(!service_account_email.empty());
DCHECK(!refresh_token.empty());
return std::make_unique<OAuthTokenGetterImpl>(
std::make_unique<OAuthTokenGetter::OAuthAuthorizationCredentials>(
service_account_email, refresh_token,
true,
std::vector<std::string>{kOAuthScope}),
url_loader_factory,
false);
}
}