Skip to content

Commit

Permalink
Apply CR
Browse files Browse the repository at this point in the history
  • Loading branch information
ogail authored and ogail committed Oct 17, 2013
1 parent c74e434 commit 43d3d1b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Expand Up @@ -142,8 +142,8 @@ public void SavingWritesProfileDataToStore()
Name = sourceEnv.Name, Name = sourceEnv.Name,
PublishSettingsFileUrl = sourceEnv.PublishSettingsFileUrl, PublishSettingsFileUrl = sourceEnv.PublishSettingsFileUrl,
ServiceEndpoint = sourceEnv.ServiceEndpoint, ServiceEndpoint = sourceEnv.ServiceEndpoint,
AdTenantUrl = sourceEnv.AdTenantUrl, ActiveDirectoryEndpoint = sourceEnv.AdTenantUrl,
CommonTenantId = sourceEnv.CommonTenantId, ActiveDirectoryCommonTenantId = sourceEnv.CommonTenantId,
StorageEndpointSuffix = sourceEnv.StorageEndpointSuffix StorageEndpointSuffix = sourceEnv.StorageEndpointSuffix
}); });


Expand Down
Expand Up @@ -76,8 +76,8 @@ public AdalConfiguration()
public AdalConfiguration(WindowsAzureEnvironment environment) public AdalConfiguration(WindowsAzureEnvironment environment)
: this() : this()
{ {
AdEndpoint = environment.AdTenantUrl; AdEndpoint = environment.ActiveDirectoryEndpoint;
AdDomain = environment.CommonTenantId; AdDomain = environment.ActiveDirectoryCommonTenantId;
} }


public AdalConfiguration(WindowsAzureSubscription subscription) public AdalConfiguration(WindowsAzureSubscription subscription)
Expand Down
Expand Up @@ -66,8 +66,8 @@ public AzureEnvironmentData(WindowsAzureEnvironment inMemoryEnvironment)
ServiceEndpoint = inMemoryEnvironment.ServiceEndpoint; ServiceEndpoint = inMemoryEnvironment.ServiceEndpoint;
ManagementPortalUrl = inMemoryEnvironment.ManagementPortalUrl; ManagementPortalUrl = inMemoryEnvironment.ManagementPortalUrl;
StorageEndpointSuffix = inMemoryEnvironment.StorageEndpointSuffix; StorageEndpointSuffix = inMemoryEnvironment.StorageEndpointSuffix;
AdTenantUrl = inMemoryEnvironment.AdTenantUrl; AdTenantUrl = inMemoryEnvironment.ActiveDirectoryEndpoint;
CommonTenantId = inMemoryEnvironment.CommonTenantId; CommonTenantId = inMemoryEnvironment.ActiveDirectoryCommonTenantId;
} }


/// <summary> /// <summary>
Expand All @@ -82,8 +82,8 @@ public WindowsAzureEnvironment ToAzureEnvironment()
ServiceEndpoint = this.ServiceEndpoint, ServiceEndpoint = this.ServiceEndpoint,
ManagementPortalUrl = this.ManagementPortalUrl, ManagementPortalUrl = this.ManagementPortalUrl,
StorageEndpointSuffix = this.StorageEndpointSuffix, StorageEndpointSuffix = this.StorageEndpointSuffix,
AdTenantUrl = this.AdTenantUrl, ActiveDirectoryEndpoint = this.AdTenantUrl,
CommonTenantId = this.CommonTenantId ActiveDirectoryCommonTenantId = this.CommonTenantId
}; };
} }


Expand Down
Expand Up @@ -47,14 +47,14 @@ public class WindowsAzureEnvironment
/// Url for the Active Directory tenant for this environment /// Url for the Active Directory tenant for this environment
/// </summary> /// </summary>
/// <remarks>If null, this environment does not support AD authentication</remarks> /// <remarks>If null, this environment does not support AD authentication</remarks>
public string AdTenantUrl { get; set; } public string ActiveDirectoryEndpoint { get; set; }


/// <summary> /// <summary>
/// Name for the common tenant used as the first step /// Name for the common tenant used as the first step
/// in the AD authentication process for this environment. /// in the AD authentication process for this environment.
/// </summary> /// </summary>
/// <remarks>If null, this environment does not support AD authentication</remarks> /// <remarks>If null, this environment does not support AD authentication</remarks>
public string CommonTenantId { get; set; } public string ActiveDirectoryCommonTenantId { get; set; }


private string storageEndpointSuffix; private string storageEndpointSuffix;


Expand Down Expand Up @@ -169,7 +169,7 @@ private string AddRealm(string baseUrl, string realm)


public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProvider) public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProvider)
{ {
if (AdTenantUrl == null) if (ActiveDirectoryEndpoint == null)
{ {
throw new Exception(string.Format(Resources.EnvironmentDoesNotSupportActiveDirectory, Name)); throw new Exception(string.Format(Resources.EnvironmentDoesNotSupportActiveDirectory, Name));
} }
Expand All @@ -185,7 +185,7 @@ public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProv
{ {
var azureSubscription = new WindowsAzureSubscription var azureSubscription = new WindowsAzureSubscription
{ {
ActiveDirectoryEndpoint = AdTenantUrl, ActiveDirectoryEndpoint = ActiveDirectoryEndpoint,
ActiveDirectoryTenantId = subscription.ActiveDirectoryTenantId, ActiveDirectoryTenantId = subscription.ActiveDirectoryTenantId,
ActiveDirectoryUserId = mainToken.UserId, ActiveDirectoryUserId = mainToken.UserId,
SubscriptionId = subscription.SubscriptionId, SubscriptionId = subscription.SubscriptionId,
Expand Down Expand Up @@ -227,8 +227,8 @@ public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProv
ServiceEndpoint = WindowsAzureEnvironmentConstants.AzureServiceEndpoint, ServiceEndpoint = WindowsAzureEnvironmentConstants.AzureServiceEndpoint,
ManagementPortalUrl = WindowsAzureEnvironmentConstants.AzureManagementPortalUrl, ManagementPortalUrl = WindowsAzureEnvironmentConstants.AzureManagementPortalUrl,
// TODO: Get real endpoint for prod // TODO: Get real endpoint for prod
AdTenantUrl = "https://login.windows.net/", ActiveDirectoryEndpoint = "https://login.windows.net/",
CommonTenantId = "common", ActiveDirectoryCommonTenantId = "common",
StorageEndpointSuffix = WindowsAzureEnvironmentConstants.AzureStorageEndpointSuffix StorageEndpointSuffix = WindowsAzureEnvironmentConstants.AzureStorageEndpointSuffix
} }
}, },
Expand Down
Expand Up @@ -53,8 +53,8 @@ public override void ExecuteCmdlet()
ServiceEndpoint = ServiceEndpoint, ServiceEndpoint = ServiceEndpoint,
ManagementPortalUrl = ManagementPortalUrl, ManagementPortalUrl = ManagementPortalUrl,
StorageEndpointSuffix = StorageEndpoint, StorageEndpointSuffix = StorageEndpoint,
AdTenantUrl = ActiveDirectoryEndpoint, ActiveDirectoryEndpoint = ActiveDirectoryEndpoint,
CommonTenantId = "Common" ActiveDirectoryCommonTenantId = "Common"
}; };


WindowsAzureProfile.Instance.AddEnvironment(newEnvironment); WindowsAzureProfile.Instance.AddEnvironment(newEnvironment);
Expand Down
Expand Up @@ -53,7 +53,7 @@ public override void ExecuteCmdlet()
env.ServiceEndpoint = Value(ServiceEndpoint, env.ServiceEndpoint); env.ServiceEndpoint = Value(ServiceEndpoint, env.ServiceEndpoint);
env.ManagementPortalUrl = Value(ManagementPortalUrl, env.ManagementPortalUrl); env.ManagementPortalUrl = Value(ManagementPortalUrl, env.ManagementPortalUrl);
env.StorageEndpointSuffix = Value(StorageEndpoint, env.StorageEndpointSuffix); env.StorageEndpointSuffix = Value(StorageEndpoint, env.StorageEndpointSuffix);
env.AdTenantUrl = Value(AdEndpointUrl, env.AdTenantUrl); env.ActiveDirectoryEndpoint = Value(AdEndpointUrl, env.ActiveDirectoryEndpoint);


WindowsAzureProfile.Instance.UpdateEnvironment(env); WindowsAzureProfile.Instance.UpdateEnvironment(env);


Expand Down

0 comments on commit 43d3d1b

Please sign in to comment.