Skip to content

Commit f5cc931

Browse files
authored
Merge pull request #154 from BingAds/remove_credentials
remove credentials in App.config
2 parents c59422f + 7a9eacb commit f5cc931

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

examples/BingAdsExamples/BingAdsConsoleApp/App.config

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
</appSettings>
1313
<userSettings>
1414
<BingAdsConsoleApp.Properties.Settings>
15-
<setting name="DeveloperToken" serializeAs="String">
16-
<value>BBD37VB98</value>
17-
</setting>
18-
<setting name="ClientId" serializeAs="String">
19-
<value>4c0b021c-00c3-4508-838f-d3127e8167ff</value>
20-
</setting>
2115
</BingAdsConsoleApp.Properties.Settings>
2216
</userSettings>
2317
</configuration>

examples/BingAdsExamples/BingAdsConsoleApp/Program.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Program
2828

2929
private static AuthorizationData _authorizationData;
3030
private static string ClientState = "ClientStateGoesHere";
31+
private static string DevToken = "BBD37VB98";
32+
private static string ClientId = "4c0b021c-00c3-4508-838f-d3127e8167ff";
3133

3234
static void Main(string[] args)
3335
{
@@ -114,7 +116,7 @@ private static Authentication AuthenticateWithOAuth()
114116
ConfigurationManager.AppSettings["BingAdsEnvironment"] == ApiEnvironment.Sandbox.ToString() ?
115117
ApiEnvironment.Sandbox : ApiEnvironment.Production;
116118
var oAuthDesktopMobileAuthCodeGrant = new OAuthDesktopMobileAuthCodeGrant(
117-
Settings.Default["ClientId"].ToString(),
119+
ClientId,
118120
apiEnvironment
119121
);
120122

@@ -244,7 +246,7 @@ private static async Task SetAuthorizationDataAsync(Authentication authenticatio
244246
_authorizationData = new AuthorizationData
245247
{
246248
Authentication = authentication,
247-
DeveloperToken = Settings.Default["DeveloperToken"].ToString()
249+
DeveloperToken = DevToken
248250
};
249251

250252
ApiEnvironment environment = ((OAuthDesktopMobileAuthCodeGrant)_authorizationData.Authentication).Environment;

0 commit comments

Comments
 (0)