diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props
index 90e1c3c3adc0..efdc30c5622a 100644
--- a/eng/Packages.Data.props
+++ b/eng/Packages.Data.props
@@ -109,7 +109,7 @@
-
+
diff --git a/sdk/identity/Azure.Identity.Broker/CHANGELOG.md b/sdk/identity/Azure.Identity.Broker/CHANGELOG.md
index 2414c7681529..1ef9c7991d4c 100644
--- a/sdk/identity/Azure.Identity.Broker/CHANGELOG.md
+++ b/sdk/identity/Azure.Identity.Broker/CHANGELOG.md
@@ -4,6 +4,7 @@
### Features Added
+- `InteractiveBrowserCredentialBrokerOptions` and `SharedTokenCacheCredentialBrokerOptions` now support a `UseOperatingSystemAccount` property to enable the use of the currently logged in operating system account for authentication rather than prompting for a credential.
- Preview support for Proof of Possession (PoP) tokens for `InteractiveBrowserCredential`. This feature is enabled via the `IsProofOfPossessionRequired` property on `InteractiveBrowserCredentialBrokerOptions`.
### Breaking Changes
diff --git a/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net462.cs b/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net462.cs
index ac2aa92cb7ad..cefab1368372 100644
--- a/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net462.cs
+++ b/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net462.cs
@@ -5,6 +5,7 @@ public partial class InteractiveBrowserCredentialBrokerOptions : Azure.Identity.
public InteractiveBrowserCredentialBrokerOptions(System.IntPtr parentWindowHandle) { }
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } }
public bool IsProofOfPossessionRequired { get { throw null; } set { } }
+ public bool UseOperatingSystemAccount { get { throw null; } set { } }
}
public partial class SharedTokenCacheCredentialBrokerOptions : Azure.Identity.SharedTokenCacheCredentialOptions
{
@@ -12,5 +13,6 @@ public SharedTokenCacheCredentialBrokerOptions() { }
public SharedTokenCacheCredentialBrokerOptions(Azure.Identity.TokenCachePersistenceOptions tokenCacheOptions) { }
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } }
public bool IsProofOfPossessionRequired { get { throw null; } set { } }
+ public bool UseOperatingSystemAccount { get { throw null; } set { } }
}
}
diff --git a/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net6.0.cs b/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net6.0.cs
index ac2aa92cb7ad..cefab1368372 100644
--- a/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net6.0.cs
+++ b/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.net6.0.cs
@@ -5,6 +5,7 @@ public partial class InteractiveBrowserCredentialBrokerOptions : Azure.Identity.
public InteractiveBrowserCredentialBrokerOptions(System.IntPtr parentWindowHandle) { }
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } }
public bool IsProofOfPossessionRequired { get { throw null; } set { } }
+ public bool UseOperatingSystemAccount { get { throw null; } set { } }
}
public partial class SharedTokenCacheCredentialBrokerOptions : Azure.Identity.SharedTokenCacheCredentialOptions
{
@@ -12,5 +13,6 @@ public SharedTokenCacheCredentialBrokerOptions() { }
public SharedTokenCacheCredentialBrokerOptions(Azure.Identity.TokenCachePersistenceOptions tokenCacheOptions) { }
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } }
public bool IsProofOfPossessionRequired { get { throw null; } set { } }
+ public bool UseOperatingSystemAccount { get { throw null; } set { } }
}
}
diff --git a/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.netstandard2.0.cs b/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.netstandard2.0.cs
index ac2aa92cb7ad..cefab1368372 100644
--- a/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.netstandard2.0.cs
+++ b/sdk/identity/Azure.Identity.Broker/api/Azure.Identity.Broker.netstandard2.0.cs
@@ -5,6 +5,7 @@ public partial class InteractiveBrowserCredentialBrokerOptions : Azure.Identity.
public InteractiveBrowserCredentialBrokerOptions(System.IntPtr parentWindowHandle) { }
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } }
public bool IsProofOfPossessionRequired { get { throw null; } set { } }
+ public bool UseOperatingSystemAccount { get { throw null; } set { } }
}
public partial class SharedTokenCacheCredentialBrokerOptions : Azure.Identity.SharedTokenCacheCredentialOptions
{
@@ -12,5 +13,6 @@ public SharedTokenCacheCredentialBrokerOptions() { }
public SharedTokenCacheCredentialBrokerOptions(Azure.Identity.TokenCachePersistenceOptions tokenCacheOptions) { }
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } }
public bool IsProofOfPossessionRequired { get { throw null; } set { } }
+ public bool UseOperatingSystemAccount { get { throw null; } set { } }
}
}
diff --git a/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs b/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs
index 5b1bf196de80..b81a57080c64 100644
--- a/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs
+++ b/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs
@@ -25,6 +25,11 @@ public class InteractiveBrowserCredentialBrokerOptions : InteractiveBrowserCrede
///
public bool IsProofOfPossessionRequired { get; set; }
+ ///
+ /// Gets or sets whether to authenticate with the currently signed in user instead of prompting the user with a login dialog.
+ ///
+ public bool UseOperatingSystemAccount { get; set; }
+
///
/// Creates a new instance of to configure a .
///
diff --git a/sdk/identity/Azure.Identity.Broker/src/SharedTokenCacheCredentialBrokerOptions.cs b/sdk/identity/Azure.Identity.Broker/src/SharedTokenCacheCredentialBrokerOptions.cs
index aac0a57c9e7c..209615c17b5e 100644
--- a/sdk/identity/Azure.Identity.Broker/src/SharedTokenCacheCredentialBrokerOptions.cs
+++ b/sdk/identity/Azure.Identity.Broker/src/SharedTokenCacheCredentialBrokerOptions.cs
@@ -23,6 +23,11 @@ public class SharedTokenCacheCredentialBrokerOptions : SharedTokenCacheCredentia
///
public bool IsProofOfPossessionRequired { get; set; }
+ ///
+ /// Gets or sets whether to authenticate with the currently signed in user instead of prompting the user with a login dialog.
+ ///
+ public bool UseOperatingSystemAccount { get; set; }
+
///
/// Initializes a new instance of .
///
diff --git a/sdk/identity/Azure.Identity.Broker/tests/InteractiveBrowserCredentialBrokerOptionsTests.cs b/sdk/identity/Azure.Identity.Broker/tests/InteractiveBrowserCredentialBrokerOptionsTests.cs
index 8142925a3283..dff847008926 100644
--- a/sdk/identity/Azure.Identity.Broker/tests/InteractiveBrowserCredentialBrokerOptionsTests.cs
+++ b/sdk/identity/Azure.Identity.Broker/tests/InteractiveBrowserCredentialBrokerOptionsTests.cs
@@ -18,11 +18,11 @@ public void RespectsMsaPassthrough(
IMsalPublicClientInitializerOptions credentialOptions;
if (enableMsaPassthrough.HasValue)
{
- credentialOptions = new InteractiveBrowserCredentialBrokerOptions(parentWindowHandle) { IsLegacyMsaPassthroughEnabled = enableMsaPassthrough.Value } as IMsalPublicClientInitializerOptions;
+ credentialOptions = new InteractiveBrowserCredentialBrokerOptions(parentWindowHandle) { IsLegacyMsaPassthroughEnabled = enableMsaPassthrough.Value };
}
else
{
- credentialOptions = new InteractiveBrowserCredentialBrokerOptions(parentWindowHandle) as IMsalPublicClientInitializerOptions;
+ credentialOptions = new InteractiveBrowserCredentialBrokerOptions(parentWindowHandle);
}
PublicClientApplicationBuilder builder = PublicClientApplicationBuilder
.Create(Guid.NewGuid().ToString());
@@ -34,6 +34,20 @@ public void RespectsMsaPassthrough(
Assert.AreEqual(parentWindowHandle, Parent());
}
+ [Test]
+ public void RespectsUseOperatingSystemAccount(
+ [Values(true, false)] bool enableUseOperatingSystemAccount)
+ {
+ IntPtr parentWindowHandle = new(1234);
+ IMsalPublicClientInitializerOptions credentialOptions;
+ credentialOptions = new InteractiveBrowserCredentialBrokerOptions(parentWindowHandle) { UseOperatingSystemAccount = enableUseOperatingSystemAccount };
+ PublicClientApplicationBuilder builder = PublicClientApplicationBuilder
+ .Create(Guid.NewGuid().ToString());
+
+ var credential = new InteractiveBrowserCredential((InteractiveBrowserCredentialBrokerOptions)credentialOptions);
+ Assert.AreEqual(enableUseOperatingSystemAccount, credential.UseOperatingSystemAccount);
+ }
+
private static (BrokerOptions Options, Func