-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(service): Add AAD auth support to Azure US Government cloud. (#1967
- Loading branch information
Showing
12 changed files
with
223 additions
and
27 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
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
26 changes: 26 additions & 0 deletions
26
iothub/service/src/DigitalTwin/DigitalTwinClientOptions.cs
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Azure.Devices | ||
{ | ||
/// <summary> | ||
/// Options that allow configuration of the DigitalTwinClient instance during initialization. | ||
/// </summary> | ||
public class DigitalTwinClientOptions | ||
{ | ||
/// <summary> | ||
/// The authentication scopes to use when requesting access tokens from Azure Active Directory for authenticating with the | ||
/// IoT Hub. | ||
/// </summary> | ||
/// <remarks> | ||
/// This value defaults <see cref="IotHubAuthenticationScopes.DefaultAuthenticationScopes"/>, which is used for | ||
/// any public or private cloud other than Azure US Government cloud. | ||
/// For Azure US Government cloud users, this value must be set to <see cref="IotHubAuthenticationScopes.AzureGovernmentAuthenticationScopes"/>. | ||
/// </remarks> | ||
public IReadOnlyList<string> TokenCredentialAuthenticationScopes { get; set; } = IotHubAuthenticationScopes.DefaultAuthenticationScopes; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Azure.Devices | ||
{ | ||
/// <summary> | ||
/// This class contains the most commonly used Azure Active Directory token audience scopes. They should be used as | ||
/// inputs when setting the authentication scopes in the client options classes. | ||
/// </summary> | ||
public static class IotHubAuthenticationScopes | ||
{ | ||
/// <summary> | ||
/// The default value for all client options. This value should be used for any public or private cloud other than Azure US Government cloud. | ||
/// </summary> | ||
public static readonly IReadOnlyList<string> DefaultAuthenticationScopes = new List<string> { "https://iothubs.azure.net/.default" }; | ||
|
||
/// <summary> | ||
/// This value should be used for Azure US Government cloud. | ||
/// </summary> | ||
public static readonly IReadOnlyList<string> AzureGovernmentAuthenticationScopes = new List<string> { "https://iothubs.azure.us/.default" }; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Azure.Devices | ||
{ | ||
/// <summary> | ||
/// Options that allow configuration of the JobClient instance during initialization. | ||
/// </summary> | ||
public class JobClientOptions | ||
{ | ||
/// <summary> | ||
/// The authentication scopes to use when requesting access tokens from Azure Active Directory for authenticating with the | ||
/// IoT Hub. | ||
/// </summary> | ||
/// <remarks> | ||
/// This value defaults <see cref="IotHubAuthenticationScopes.DefaultAuthenticationScopes"/>, which is used for | ||
/// any public or private cloud other than Azure US Government cloud. | ||
/// For Azure US Government cloud users, this value must be set to <see cref="IotHubAuthenticationScopes.AzureGovernmentAuthenticationScopes"/>. | ||
/// </remarks> | ||
public IReadOnlyList<string> TokenCredentialAuthenticationScopes { get; set; } = IotHubAuthenticationScopes.DefaultAuthenticationScopes; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Azure.Devices | ||
{ | ||
/// <summary> | ||
/// Options that allow configuration of the RegistryManager instance during initialization. | ||
/// </summary> | ||
public class RegistryManagerOptions | ||
{ | ||
/// <summary> | ||
/// The authentication scopes to use when requesting access tokens from Azure Active Directory for authenticating with the | ||
/// IoT Hub. | ||
/// </summary> | ||
/// <remarks> | ||
/// This value defaults <see cref="IotHubAuthenticationScopes.DefaultAuthenticationScopes"/>, which is used for | ||
/// any public or private cloud other than Azure US Government cloud. | ||
/// For Azure US Government cloud users, this value must be set to <see cref="IotHubAuthenticationScopes.AzureGovernmentAuthenticationScopes"/>. | ||
/// </remarks> | ||
public IReadOnlyList<string> TokenCredentialAuthenticationScopes { get; set; } = IotHubAuthenticationScopes.DefaultAuthenticationScopes; | ||
} | ||
} |
Oops, something went wrong.