Skip to content

Commit

Permalink
remove appSettings and AAD tenant apis
Browse files Browse the repository at this point in the history
  • Loading branch information
suwatch committed Jan 9, 2015
1 parent e635ffc commit 8bf0a37
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 45 deletions.
25 changes: 14 additions & 11 deletions ARMClient.Authentication/AADAuthentication/BaseAuthHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,20 @@ protected async Task<Dictionary<string, TenantCacheInfo>> GetTokenForTenants(Dic
continue;
}

try
{
var details = await GetTenantDetail(result, tenantId);
info.displayName = details.displayName;
info.domain = details.verifiedDomains.First(d => d.@default).name;
Trace.WriteLine(string.Format("User: {0}, Tenant: {1} {2} ({3})", result.UserInfo.UserId, tenantId, details.displayName, details.verifiedDomains.First(d => d.@default).name));
}
catch (Exception ex)
{
Trace.WriteLine(string.Format("User: {0}, Tenant: {1} {2}", result.UserInfo.UserId, tenantId, ex.Message));
}
// blocked on Graph API failure
//try
//{
// var details = await GetTenantDetail(result, tenantId);
// info.displayName = details.displayName;
// info.domain = details.verifiedDomains.First(d => d.@default).name;
// Trace.WriteLine(string.Format("User: {0}, Tenant: {1} {2} ({3})", result.UserInfo.UserId, tenantId, details.displayName, details.verifiedDomains.First(d => d.@default).name));
//}
//catch (Exception ex)
//{
// Trace.WriteLine(string.Format("User: {0}, Tenant: {1} {2}", result.UserInfo.UserId, tenantId, ex.Message));
//}

Trace.WriteLine(string.Format("User: {0}, Tenant: {1}", result.UserInfo.UserId, tenantId));

try
{
Expand Down
26 changes: 4 additions & 22 deletions ARMClient.Authentication/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Configuration;


namespace ARMClient.Authentication
{
internal class Constants
Expand Down Expand Up @@ -34,27 +33,10 @@ internal class Constants
"f8cdef31-a31e-4b4a-93e4-5f571e91255a"
};

public const string AzureToolClientId = "1950a258-227b-4e31-a9cf-717495945fc2";
public const string AADTenantId = "common";
public const string AADClientId = "1950a258-227b-4e31-a9cf-717495945fc2";
public const string AADRedirectUri = "urn:ietf:wg:oauth:2.0:oob";
public const string CSMApiVersion = "2014-01-01";
public const string AADGraphApiVersion = "1.5";

private static string _aadTenantId;
private static string _aadClientId;
private static string _aadRedirectUri;

public static string AADTenantId
{
get { return _aadTenantId ?? (_aadTenantId = ConfigurationManager.AppSettings["AADTenantId"]); }
}

public static string AADClientId
{
get { return _aadClientId ?? (_aadClientId = ConfigurationManager.AppSettings["AADClientId"]); }
}

public static string AADRedirectUri
{
get { return _aadRedirectUri ?? (_aadRedirectUri = ConfigurationManager.AppSettings["AADRedirectUri"]); }
}
}
}
6 changes: 0 additions & 6 deletions ARMClient.Console/App.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<!-- Azure Powershell Tool -->
<add key="AADTenantId" value="common"/>
<add key="AADClientId" value="1950a258-227b-4e31-a9cf-717495945fc2"/>
<add key="AADRedirectUri" value="urn:ietf:wg:oauth:2.0:oob"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
Expand Down
6 changes: 0 additions & 6 deletions ARMClient.Library.Runner/App.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<!-- Azure Powershell Tool -->
<add key="AADTenantId" value="common"/>
<add key="AADClientId" value="1950a258-227b-4e31-a9cf-717495945fc2"/>
<add key="AADRedirectUri" value="urn:ietf:wg:oauth:2.0:oob"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
Expand Down

0 comments on commit 8bf0a37

Please sign in to comment.