forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Az.Accounts] Supported tenant domain as input while logging in. (Azu…
…re#19492) * Support tenant domain as input while logging in. * Update ChangeLog. * Update src/Accounts/Accounts/Models/RMProfileClient.cs Co-authored-by: Yunchi Wang <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
- Loading branch information
1 parent
6cbf87c
commit 9df3fa5
Showing
5 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,36 @@ public void SpecifyTenantAndSubscriptionIdSucceed() | |
Assert.Equal("2021-01-01", client.SubscriptionAndTenantClient.ApiVersion); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void SpecifyTenantDomainAndSubscriptionIdSucceed() | ||
{ | ||
var tenants = new List<string> { DefaultTenant.ToString() }; | ||
var firstList = new List<string> { DefaultSubscription.ToString(), Guid.NewGuid().ToString() }; | ||
var secondList = new List<string> { Guid.NewGuid().ToString() }; | ||
var client = SetupTestEnvironment(tenants, firstList, secondList); | ||
|
||
((MockTokenAuthenticationFactory)AzureSession.Instance.AuthenticationFactory).TokenProvider = (account, environment, tenant) => | ||
new MockAccessToken | ||
{ | ||
UserId = "[email protected]", | ||
LoginType = LoginType.OrgId, | ||
AccessToken = "bbb", | ||
TenantId = DefaultTenant.ToString() | ||
}; | ||
|
||
var azureRmProfile = client.Login( | ||
Context.Account, | ||
Context.Environment, | ||
MockSubscriptionClientFactory.GetTenantDomainFromId(DefaultTenant.ToString()), | ||
DefaultSubscription.ToString(), | ||
null, | ||
null, | ||
false, | ||
null); | ||
Assert.Equal("2021-01-01", client.SubscriptionAndTenantClient.ApiVersion); | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
public void SubscriptionIdNotExist() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters