Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ public static ConfidentialClientApplicationBuilder WithCertificate(
Func<AssertionRequestOptions, Task<X509Certificate2>> certificateProvider,
CertificateOptions certificateOptions)
{
builder.ValidateUseOfExperimentalFeature();

if (certificateProvider == null)
{
throw new ArgumentNullException(nameof(certificateProvider));
Expand Down Expand Up @@ -125,8 +123,6 @@ public static ConfidentialClientApplicationBuilder OnMsalServiceFailure(
this ConfidentialClientApplicationBuilder builder,
Func<AssertionRequestOptions, ExecutionResult, Task<bool>> onMsalServiceFailure)
{
builder.ValidateUseOfExperimentalFeature();

if (onMsalServiceFailure == null)
throw new ArgumentNullException(nameof(onMsalServiceFailure));

Expand Down Expand Up @@ -179,8 +175,6 @@ public static ConfidentialClientApplicationBuilder OnCompletion(
this ConfidentialClientApplicationBuilder builder,
Func<AssertionRequestOptions, ExecutionResult, Task> onCompletion)
{
builder.ValidateUseOfExperimentalFeature();

if (onCompletion == null)
{
throw new ArgumentNullException(nameof(onCompletion));
Expand Down Expand Up @@ -212,8 +206,6 @@ public static ConfidentialClientApplicationBuilder OnBackgroundTokenRefreshCompl
this ConfidentialClientApplicationBuilder builder,
Func<ExecutionResult, Task> onBackgroundTokenRefreshCompleted)
{
builder.ValidateUseOfExperimentalFeature();

if (onBackgroundTokenRefreshCompleted == null)
{
throw new ArgumentNullException(nameof(onBackgroundTokenRefreshCompleted));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Task<X509Certificate2> certificateProvider(AssertionRequestOptions options)
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, _certificateOptions)
.BuildConcrete();

Expand All @@ -66,7 +65,6 @@ public void WithCertificate_ThrowsOnNullCallback()
var ex = Assert.Throws<ArgumentNullException>(() =>
ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate((Func<AssertionRequestOptions, Task<X509Certificate2>>) null, null)
.Build());

Expand Down Expand Up @@ -95,7 +93,6 @@ Task<X509Certificate2> secondProvider(AssertionRequestOptions options)
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(firstProvider, _certificateOptions)
.WithCertificate(secondProvider, _certificateOptions)
.BuildConcrete();
Expand All @@ -117,7 +114,6 @@ public void WithCertificate_CertificateOptions_SendX5C_True_IsStored()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, certificateOptions)
.BuildConcrete();

Expand All @@ -137,7 +133,6 @@ public void WithCertificate_CertificateOptions_SendX5C_False_IsStored()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, certificateOptions)
.BuildConcrete();

Expand All @@ -156,7 +151,6 @@ public void WithCertificate_NullCertificateOptions_DefaultsToSendX5C_False()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, null)
.BuildConcrete();

Expand All @@ -176,7 +170,6 @@ public void WithCertificate_CertificateOptions_AssociateTokensWithCertificateSer
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, certificateOptions)
.BuildConcrete();

Expand All @@ -197,7 +190,6 @@ public void WithCertificate_CertificateOptions_AssociateTokensWithCertificateSer
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, certificateOptions)
.BuildConcrete();

Expand All @@ -222,7 +214,6 @@ public void WithCertificate_CertificateOptions_BothPropertiesSet_AreStored()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, certificateOptions)
.BuildConcrete();

Expand All @@ -247,7 +238,6 @@ public void OnMsalServiceFailure_CallbackIsStored()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithClientSecret(TestConstants.ClientSecret)
.OnMsalServiceFailure(onMsalServiceFailureCallback)
.BuildConcrete();
Expand All @@ -263,7 +253,6 @@ public void OnMsalServiceFailure_ThrowsOnNullCallback()
var ex = Assert.Throws<ArgumentNullException>(() =>
ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithClientSecret(TestConstants.ClientSecret)
.OnMsalServiceFailure(null)
.Build());
Expand All @@ -284,7 +273,6 @@ public void OnSuccess_CallbackIsStored()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithClientSecret(TestConstants.ClientSecret)
.OnCompletion(onSuccessCallback)
.BuildConcrete();
Expand All @@ -300,7 +288,6 @@ public void OnSuccess_ThrowsOnNullCallback()
var ex = Assert.Throws<ArgumentNullException>(() =>
ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithClientSecret(TestConstants.ClientSecret)
.OnCompletion(null)
.Build());
Expand Down Expand Up @@ -387,7 +374,6 @@ public void AllThreeExtensibilityPoints_CanBeConfiguredTogether()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithCertificate(certificateProvider, _certificateOptions)
.OnMsalServiceFailure(onMsalServiceFailure)
.OnCompletion(onSuccess)
Expand All @@ -411,7 +397,6 @@ public void ExtensibilityPoints_CanBeConfiguredInAnyOrder()
// Act - Order: OnCompletion, OnMsalServiceFailure, Certificate
var app1 = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.OnCompletion(onSuccess)
.OnMsalServiceFailure(onMsalServiceFailure)
.WithCertificate(certificateProvider, _certificateOptions)
Expand All @@ -420,7 +405,6 @@ public void ExtensibilityPoints_CanBeConfiguredInAnyOrder()
// Act - Order: OnMsalServiceFailure, Certificate, OnCompletion
var app2 = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.OnMsalServiceFailure(onMsalServiceFailure)
.WithCertificate(certificateProvider, _certificateOptions)
.OnCompletion(onSuccess)
Expand Down Expand Up @@ -453,7 +437,6 @@ Task<X509Certificate2> certificateProvider(AssertionRequestOptions options)
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AadAuthorityWithTestTenantId)
.WithCertificate(certificateProvider, _certificateOptions)
.BuildConcrete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public void WithCertificate_CertificateOptions_SendX5C_False()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithCertificate((AssertionRequestOptions options) =>
{
Expand All @@ -62,7 +61,6 @@ public void WithCertificate_CertificateOptions_SendX5C_True()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithCertificate((AssertionRequestOptions options) =>
{
Expand All @@ -84,7 +82,6 @@ public void WithCertificate_NullCertificateOptions_DefaultsToFalse()
// Act
var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithCertificate((AssertionRequestOptions options) =>
{
Expand All @@ -110,7 +107,6 @@ public async Task CertificateOptions_SendX5C_True_InTokenAcquisitionAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithCertificate((AssertionRequestOptions options) =>
Expand Down Expand Up @@ -146,7 +142,6 @@ public async Task CertificateOptions_SendX5C_False_InTokenAcquisitionAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithCertificate((AssertionRequestOptions options) =>
Expand Down Expand Up @@ -183,7 +178,6 @@ public async Task CertificateOptions_WorksWithRetryScenarioAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithCertificate((AssertionRequestOptions options) =>
Expand Down Expand Up @@ -232,7 +226,6 @@ public async Task DynamicCertificateProvider_IsInvoked_AndUsedForAssertionAsync(

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithCertificate((AssertionRequestOptions options) =>
Expand Down Expand Up @@ -274,7 +267,6 @@ public async Task DynamicCertificateProvider_ReturnsNull_ThrowsExceptionAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithCertificate((AssertionRequestOptions options) =>
Expand Down Expand Up @@ -315,7 +307,6 @@ public async Task OnMsalServiceFailure_RetriesOnServiceError_SucceedsAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithCertificate(cert)
.WithHttpManager(harness.HttpManager)
Expand Down Expand Up @@ -368,7 +359,6 @@ public async Task OnMsalServiceFailure_ReturnsFalse_PropagatesExceptionAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithClientSecret(TestConstants.ClientSecret)
.WithHttpManager(harness.HttpManager)
Expand Down Expand Up @@ -410,7 +400,6 @@ public async Task OnMsalServiceFailure_NotInvokedForClientExceptionsAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithCertificate((AssertionRequestOptions options) =>
{
Expand Down Expand Up @@ -455,7 +444,6 @@ public async Task OnSuccess_InvokedWithSuccessfulResultAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithClientSecret(TestConstants.ClientSecret)
.WithHttpManager(harness.HttpManager)
Expand Down Expand Up @@ -512,7 +500,6 @@ public async Task OnSuccess_InvokedWithFailureResult_AfterRetriesExhaustedAsync(

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithCertificate(certificate)
.WithHttpManager(harness.HttpManager)
Expand Down Expand Up @@ -576,7 +563,6 @@ public async Task OnSuccess_ExceptionIsCaught_DoesNotDisruptFlowAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithClientSecret(TestConstants.ClientSecret)
.WithHttpManager(harness.HttpManager)
Expand Down Expand Up @@ -623,7 +609,6 @@ public async Task AllThreeExtensibilityPoints_WorkTogetherAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithLogging(logCallback, LogLevel.Info, enablePiiLogging: true, enableDefaultPlatformLogging: false)
Expand Down Expand Up @@ -691,7 +676,6 @@ public async Task CertificateRotation_DifferentCertOnRetryAsync()

var app = ConfidentialClientApplicationBuilder
.Create(TestConstants.ClientId)
.WithExperimentalFeatures()
.WithAuthority(TestConstants.AuthorityCommonTenant)
.WithHttpManager(harness.HttpManager)
.WithCertificate((AssertionRequestOptions options) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ public async Task ClientCredentials_BackgroundRefresh_Success_InvokesCallback_As
.WithAuthority(AzureCloudInstance.AzurePublic, TestConstants.Utid)
.WithClientSecret(TestConstants.ClientSecret)
.WithHttpManager(harness.HttpManager)
.WithExperimentalFeatures()
.OnBackgroundTokenRefreshCompleted(r => { capturedResult = r; return Task.CompletedTask; })
.BuildConcrete();
TokenCacheHelper.PopulateCache(app.AppTokenCacheInternal.Accessor, addSecondAt: false);
Expand Down Expand Up @@ -587,7 +586,6 @@ public async Task ClientCredentials_BackgroundRefresh_Failure_InvokesCallbackWit
.WithAuthority(AzureCloudInstance.AzurePublic, TestConstants.Utid)
.WithClientSecret(TestConstants.ClientSecret)
.WithHttpManager(harness.HttpManager)
.WithExperimentalFeatures()
.OnBackgroundTokenRefreshCompleted(r => { capturedResult = r; return Task.CompletedTask; })
.BuildConcrete();
TokenCacheHelper.PopulateCache(app.AppTokenCacheInternal.Accessor, addSecondAt: false);
Expand Down Expand Up @@ -622,7 +620,6 @@ public async Task ClientCredentials_ProactiveRefresh_Canceled_DoesNotInvokeCallb
.WithAuthority(AzureCloudInstance.AzurePublic, TestConstants.Utid)
.WithClientSecret(TestConstants.ClientSecret)
.WithHttpManager(harness.HttpManager)
.WithExperimentalFeatures()
.WithLogging(LocalLogCallback)
.OnBackgroundTokenRefreshCompleted(r => { capturedResult = r; return Task.CompletedTask; })
.BuildConcrete();
Expand Down
Loading