Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5d0038c
[Identity] Adding AdditionallyAllowedTenants to constrain multi-tenan…
schaabs Aug 29, 2022
aaa4257
updating API spec
schaabs Aug 29, 2022
fdb98b1
adding dev-time credentials
schaabs Sep 7, 2022
3b64be6
adding user-auth credentials
schaabs Sep 7, 2022
57d6d1d
refactor additional tenants to base options
schaabs Sep 7, 2022
11a7298
adding default and environment credentials
schaabs Sep 7, 2022
8740be7
update/add tests
schaabs Sep 12, 2022
53ac2ff
update API spec
schaabs Sep 12, 2022
aad7710
update changelog and breaking_changes
schaabs Sep 12, 2022
8c00cd9
update assembly version
schaabs Sep 12, 2022
d651a03
Update sdk/identity/Azure.Identity/CHANGELOG.md
schaabs Sep 12, 2022
4663156
Update sdk/identity/Azure.Identity/CHANGELOG.md
schaabs Sep 12, 2022
1758a66
Update sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeC…
schaabs Sep 12, 2022
cf3f51d
Update sdk/identity/Azure.Identity/src/TenantIdResolver.cs
schaabs Sep 12, 2022
c70f042
Update sdk/identity/Azure.Identity/CHANGELOG.md
schaabs Sep 13, 2022
da48964
fb
schaabs Sep 14, 2022
8da2477
fb
schaabs Sep 14, 2022
2d90793
fb
schaabs Sep 14, 2022
b2a4235
fb
schaabs Sep 14, 2022
938f72c
fb
schaabs Sep 14, 2022
c0f2e4f
Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCreden…
schaabs Sep 14, 2022
a6208e9
Update sdk/identity/Azure.Identity/src/Credentials/ClientAssertionCre…
schaabs Sep 14, 2022
39a8ce8
Update sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCre…
schaabs Sep 14, 2022
038769f
Update sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCre…
schaabs Sep 14, 2022
98eb043
Update sdk/identity/Azure.Identity/src/Credentials/AzureCliCredential…
schaabs Sep 14, 2022
70dee65
Update sdk/identity/Azure.Identity/CHANGELOG.md
schaabs Sep 14, 2022
a9044bb
Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCreden…
schaabs Sep 14, 2022
507850e
Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCr…
schaabs Sep 14, 2022
59cefbe
Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCr…
schaabs Sep 14, 2022
a51788a
Update sdk/identity/Azure.Identity/src/Credentials/TokenCredentialOpt…
schaabs Sep 14, 2022
6b00e60
Update sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCr…
schaabs Sep 14, 2022
f62d4e7
Update sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredenti…
schaabs Sep 14, 2022
f68371c
Update sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowser…
schaabs Sep 14, 2022
c4f277f
Update sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredenti…
schaabs Sep 14, 2022
ced25a0
Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCreden…
schaabs Sep 14, 2022
a0add20
Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCreden…
schaabs Sep 14, 2022
a2df13b
Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCreden…
schaabs Sep 14, 2022
d428fab
Update sdk/identity/Azure.Identity/src/Credentials/ClientSecretCreden…
schaabs Sep 14, 2022
74f50d7
Update sdk/identity/Azure.Identity/src/Credentials/ClientCertificateC…
schaabs Sep 14, 2022
48a3b9e
updating troubleshooting.md
schaabs Sep 14, 2022
c62ad15
Merge branch 'feature/additionaltenants' of https://github.com/schaab…
schaabs Sep 14, 2022
8bf00bd
update snippets
schaabs Sep 14, 2022
287bd02
undo snippet indent
schaabs Sep 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/identity/Azure.Identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Added `TenantId` to `DefaultAzureCredentialOptions` to avoid having to set `InteractiveBrowserTenantId`, `SharedTokenCacheTenantId`, `VisualStudioCodeTenantId`, and `VisualStudioTenantId` individually.

### Breaking Changes
- Credential types supporting multi-tenant authentication will now throw `AuthenticationFailedException` if the requested tenant ID doesn't match the tenant id of the credential, and is not included in the `AdditionallyAllowedTenants` option. Applications must now explicitly add additional tenents to the `AdditionallyAllowedTenants` list, or add '*' to list, to enable acquiring tokens from tenants other than the originally specified tenant ID. See [BREAKING_CHANGES.md](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/BREAKING_CHANGES.md#170)
- Credential types supporting multi-tenant authentication will now throw `AuthenticationFailedException` if the requested tenant ID doesn't match the credential's tenant ID, and is not included in the `AdditionallyAllowedTenants` option. Applications must now explicitly add additional tenants to the `AdditionallyAllowedTenants` list, or add '*' to list, to enable acquiring tokens from tenants other than the originally specified tenant ID. See [BREAKING_CHANGES.md](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/BREAKING_CHANGES.md#170).

## 1.7.0-beta.1 (2022-08-09)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Azure.Identity
public class AzureCliCredentialOptions : TokenCredentialOptions
{
/// <summary>
/// The tenant ID the credential will authenticate to by default. If not specified the credential will authenticate to any requested tenant, and will default to the tenant specified to the 'az login' command.
/// The ID of the tenant to which the credential will authenticate by default. If not specified, the credential will authenticate to any requested tenant, and will default to the tenant provided to the 'az login' command.
/// </summary>
public string TenantId { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ namespace Azure.Identity
public class AzurePowerShellCredentialOptions : TokenCredentialOptions
{
/// <summary>
/// The tenant ID the credential will authenticate to by default. If not specified the credential will authenticate to any requested tenant, and will default to the tenant specified to the 'Connect-AzAccount' cmdlet.
/// The ID of the tenant to which the credential will authenticate by default. If not specified, the credential will authenticate to any requested tenant, and will default to the tenant provided to the 'Connect-AzAccount' cmdlet.
/// </summary>
public string TenantId { get; set; }

/// <summary>
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
/// If no value is specified for <see cref="TenantId"/> this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ClientAssertionCredentialOptions : TokenCredentialOptions
internal MsalConfidentialClient MsalClient { get; set; }

/// <summary>
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the application is installed.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ClientCertificateCredentialOptions : TokenCredentialOptions, IToken
public bool SendCertificateChain { get; set; }

/// <summary>
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the application is installed.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ClientSecretCredentialOptions : TokenCredentialOptions, ITokenCache
public TokenCachePersistenceOptions TokenCachePersistenceOptions { get; set; }

/// <summary>
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the application is installed.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public T Value
private UpdateTracker<string> _visualStudioCodeTenantId = new UpdateTracker<string>(GetNonEmptyStringOrNull(EnvironmentVariables.TenantId));

/// <summary>
/// The tenant ID the credential will authenticate to by default. If not specified the credential will authenticate to any requested tenant, and will default to the tenant to which the chosen authetication method was originally authenticated.
/// The ID of the tenant to which the credential will authenticate by default. If not specified, the credential will authenticate to any requested tenant, and will default to the tenant to which the chosen authentication method was originally authenticated.
/// </summary>
public string TenantId
{
Expand Down Expand Up @@ -143,7 +143,7 @@ public string VisualStudioTenantId
}

/// <summary>
/// The tenant id of the user to authenticate, in the case the <see cref="DefaultAzureCredential"/> authenticates through, the
/// The tenant ID of the user to authenticate, in the case the <see cref="DefaultAzureCredential"/> authenticates through, the
/// <see cref="VisualStudioCodeCredential"/>. The default is null and will authenticate users to their default tenant.
/// The value can also be set by setting the environment variable AZURE_TENANT_ID.
/// </summary>
Expand All @@ -165,7 +165,7 @@ public string VisualStudioCodeTenantId
/// <summary>
/// Specifies tenants in addition to the specified <see cref="InteractiveBrowserTenantId"/>, <see cref="VisualStudioTenantId"/>, <see cref="VisualStudioCodeTenantId"/>, <see cref="SharedTokenCacheTenantId"/>, for which the credential may acquire tokens.
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
/// If no value is specified for any of the above tenant this option will have no effect on that authentication method, and the credential will acquire tokens for any requested tenant when using that method.
/// If no value is specified for any of the above tenants, this option will have no effect on that authentication method, and the credential will acquire tokens for any requested tenant when using that method.
/// This value can also be set by setting the environment variable AZURE_ADDITOINAL_ALLOWED_TENANTS.
/// </summary>
public IList<string> AdditionallyAllowedTenants { get; private set; } = EnvironmentVariables.AdditionallyAllowedTenants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public string TenantId
/// <summary>
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
/// If no value is specified for <see cref="TenantId"/> this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public string TenantId
/// <summary>
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
/// If no value is specified for <see cref="TenantId"/> this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class OnBehalfOfCredentialOptions : TokenCredentialOptions, ITokenCacheOp
public bool SendCertificateChain { get; set; }

/// <summary>
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the application is installed.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Uri AuthorityHost
internal bool IsLoggingPIIEnabled { get; set; }

/// <summary>
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the application is installed.
/// </summary>
internal List<string> AdditionallyAllowedTenantsCore { get; set; } = new List<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class UsernamePasswordCredentialOptions : TokenCredentialOptions, ITokenC
public TokenCachePersistenceOptions TokenCachePersistenceOptions { get; set; }

/// <summary>
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the application is installed.
/// For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the application is installed.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class VisualStudioCodeCredentialOptions : TokenCredentialOptions
private string _tenantId;

/// <summary>
/// The tenant ID the user will be authenticated to. If not specified the user will be authenticated to any requested tenant, and by default to the tenant the user originally authenticated to via the Visual Studio Code Azure Account plugin.
/// The tenant ID the user will be authenticated to. If not specified, the user will be authenticated to any requested tenant, and by default to the tenant the user originally authenticated to via the Visual Studio Code Azure Account extension.
/// </summary>
public string TenantId
{
Expand All @@ -26,7 +26,7 @@ public string TenantId
/// <summary>
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
/// If no value is specified for <see cref="TenantId"/> this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class VisualStudioCredentialOptions : TokenCredentialOptions
private string _tenantId;

/// <summary>
/// The tenant ID the credential will be authenticated to by default. If not specified the credential will authenticate to any requested tenant, and will default to the tenant the user originally authenticated to via the Visual Studio Azure Service Account dialog.
/// The tenant ID the credential will be authenticated to by default. If not specified, the credential will authenticate to any requested tenant, and will default to the tenant the user originally authenticated to via the Visual Studio Azure Service Account dialog.
/// </summary>
public string TenantId
{
Expand All @@ -24,7 +24,7 @@ public string TenantId
/// <summary>
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
/// If no value is specified for <see cref="TenantId"/> this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect, and the credential will acquire tokens for any requested tenant.
/// </summary>
public IList<string> AdditionallyAllowedTenants => AdditionallyAllowedTenantsCore;
}
Expand Down