I have a Service Account setup and I am trying to get my app to authenticate against this Service Account and ultimately call SearchStream()
I have the following code. Upon GetAccessTokenForRequestAsync() method being called we receive a Status = WaitingForActivation message.
I have checked this Service Account and it shows a green check for status. What am I missing?
GoogleAdsClient _client = GoogleServiceAccountAuthentication.GetGoogleAdsClient();
var clientToken = _client.Config.Credentials.GetAccessTokenForRequestAsync();
public static GoogleAdsClient GetGoogleAdsClient()
{
return new GoogleAdsClient(GetGoogleAdsConfig());
}
/// <summary>
/// Get the GoolgeAds Service Account Configuration
/// </summary>
/// <returns>GoogleAdsConfig object containing configuration settings</returns>
public static GoogleAdsConfig GetGoogleAdsConfig()
{
GoogleAdsConfig config = new GoogleAdsConfig()
{
OAuth2SecretsJsonPath = "Keys/xxxxxx.json",
OAuth2Mode = OAuth2Flow.SERVICE_ACCOUNT
};
config.OAuth2ClientId = "xxxxxxxx";
config.DeveloperToken = "xxxxxx";
return config;
}