| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | |
|
| | 6 | | namespace Azure.Identity |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Options to configure the <see cref="DefaultAzureCredential"/> authentication flow and requests made to Azure Ide |
| | 10 | | /// </summary> |
| | 11 | | public class DefaultAzureCredentialOptions : TokenCredentialOptions |
| | 12 | | { |
| | 13 | | /// <summary> |
| | 14 | | /// The tenant id of the user to authenticate, in the case the <see cref="DefaultAzureCredential"/> authenticate |
| | 15 | | /// <see cref="InteractiveBrowserCredential"/>. The default is null and will authenticate users to their default |
| | 16 | | /// The value can also be set by setting the environment variable AZURE_TENANT_ID. |
| | 17 | | /// </summary> |
| 1758 | 18 | | public string InteractiveBrowserTenantId { get; set; } = EnvironmentVariables.TenantId; |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Specifies the tenant id of the preferred authentication account, to be retrieved from the shared token cache |
| | 22 | | /// development tools, in the case multiple accounts are found in the shared token. |
| | 23 | | /// </summary> |
| | 24 | | /// <remarks> |
| | 25 | | /// If multiple accounts are found in the shared token cache and no value is specified, or the specified value m |
| | 26 | | /// the cache the SharedTokenCacheCredential will not be used for authentication. |
| | 27 | | /// </remarks> |
| 1760 | 28 | | public string SharedTokenCacheTenantId { get; set; } = EnvironmentVariables.TenantId; |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// The tenant id of the user to authenticate, in the case the <see cref="DefaultAzureCredential"/> authenticate |
| | 32 | | /// <see cref="VisualStudioCredential"/>. The default is null and will authenticate users to their default tenan |
| | 33 | | /// The value can also be set by setting the environment variable AZURE_TENANT_ID. |
| | 34 | | /// </summary> |
| 1788 | 35 | | public string VisualStudioTenantId { get; set; } = EnvironmentVariables.TenantId; |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// The tenant id of the user to authenticate, in the case the <see cref="DefaultAzureCredential"/> authenticate |
| | 39 | | /// <see cref="VisualStudioCodeCredential"/>. The default is null and will authenticate users to their default t |
| | 40 | | /// The value can also be set by setting the environment variable AZURE_TENANT_ID. |
| | 41 | | /// </summary> |
| 1804 | 42 | | public string VisualStudioCodeTenantId { get; set; } = EnvironmentVariables.TenantId; |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Specifies the preferred authentication account to be retrieved from the shared token cache for single sign o |
| | 46 | | /// development tools. In the case multiple accounts are found in the shared token. |
| | 47 | | /// </summary> |
| | 48 | | /// <remarks> |
| | 49 | | /// If multiple accounts are found in the shared token cache and no value is specified, or the specified value m |
| | 50 | | /// the cache the SharedTokenCacheCredential will not be used for authentication. |
| | 51 | | /// </remarks> |
| 1760 | 52 | | public string SharedTokenCacheUsername { get; set; } = EnvironmentVariables.Username; |
| | 53 | |
|
| | 54 | | /// <summary> |
| | 55 | | /// Specifies the client id of the azure ManagedIdentity in the case of user assigned identity. |
| | 56 | | /// </summary> |
| 1784 | 57 | | public string ManagedIdentityClientId { get; set; } = EnvironmentVariables.ClientId; |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Specifies whether the <see cref="EnvironmentCredential"/> will be excluded from the authentication flow. Set |
| | 61 | | /// authentication details from the process' environment variables. |
| | 62 | | /// </summary> |
| 2282 | 63 | | public bool ExcludeEnvironmentCredential { get; set; } = false; |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Specifies whether the <see cref="ManagedIdentityCredential"/> will be excluded from the <see cref="DefaultAz |
| | 67 | | /// Setting to true disables authenticating with managed identity endpoints. |
| | 68 | | /// </summary> |
| 2258 | 69 | | public bool ExcludeManagedIdentityCredential { get; set; } = false; |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// Specifies whether the <see cref="SharedTokenCacheCredential"/> will be excluded from the <see cref="DefaultA |
| | 73 | | /// Setting to true disables single sign on authentication with development tools which write to the shared toke |
| | 74 | | /// </summary> |
| 2282 | 75 | | public bool ExcludeSharedTokenCacheCredential { get; set; } = false; |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Specifies whether the <see cref="InteractiveBrowserCredential"/> will be excluded from the <see cref="Defaul |
| | 79 | | /// Setting to true disables launching the default system browser to authenticate in development environments. |
| | 80 | | /// </summary> |
| 3436 | 81 | | public bool ExcludeInteractiveBrowserCredential { get; set; } = true; |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Specifies whether the <see cref="AzureCliCredential"/> will be excluded from the <see cref="DefaultAzureCred |
| | 85 | | /// </summary> |
| 2254 | 86 | | public bool ExcludeAzureCliCredential { get; set; } = false; |
| | 87 | |
|
| | 88 | | /// <summary> |
| | 89 | | /// Specifies whether the <see cref="VisualStudioCredential"/> will be excluded from the <see cref="DefaultAzure |
| | 90 | | /// </summary> |
| 2198 | 91 | | public bool ExcludeVisualStudioCredential { get; set; } = false; |
| | 92 | |
|
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Specifies whether the <see cref="VisualStudioCodeCredential"/> will be excluded from the <see cref="DefaultA |
| | 96 | | /// </summary> |
| 2198 | 97 | | public bool ExcludeVisualStudioCodeCredential { get; set; } = false; |
| | 98 | | } |
| | 99 | | } |