Skip to content

Commit 4fc53c8

Browse files
authored
Identity release archboard feedback (Azure#38166)
1 parent 94de10c commit 4fc53c8

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

sdk/identity/Azure.Identity.BrokeredAuthentication/api/Azure.Identity.BrokeredAuthentication.net462.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ namespace Azure.Identity.BrokeredAuthentication
33
public partial class InteractiveBrowserCredentialBrokerOptions : Azure.Identity.InteractiveBrowserCredentialOptions
44
{
55
public InteractiveBrowserCredentialBrokerOptions(System.IntPtr parentWindowHandle) { }
6+
public bool? IsMsaPassthroughEnabled { get { throw null; } set { } }
67
}
78
public partial class SharedTokenCacheCredentialBrokerOptions : Azure.Identity.SharedTokenCacheCredentialOptions
89
{
910
public SharedTokenCacheCredentialBrokerOptions() { }
1011
public SharedTokenCacheCredentialBrokerOptions(Azure.Identity.TokenCachePersistenceOptions tokenCacheOptions) { }
12+
public bool? IsMsaPassthroughEnabled { get { throw null; } set { } }
1113
}
1214
}

sdk/identity/Azure.Identity/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## 1.10.0-beta.2 (Unreleased)
44

55
### Features Added
6-
- Add `BrowserCustomizedOptions` to `InteractiveBrowserCredential` to enable web view customization for interactive authentication.
6+
- Added `BrowserCustomization` property to `InteractiveBrowserCredential` to enable web view customization for interactive authentication.
77

88
### Breaking Changes
99

sdk/identity/Azure.Identity/api/Azure.Identity.netstandard2.0.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ public AzurePowerShellCredentialOptions() { }
9494
}
9595
public partial class BrowserCustomizationOptions
9696
{
97-
public bool? UseEmbeddedWebView;
9897
public BrowserCustomizationOptions() { }
99-
public string HtmlMessageError { get { throw null; } set { } }
100-
public string HtmlMessageSuccess { get { throw null; } set { } }
98+
public string ErrorMessage { get { throw null; } set { } }
99+
public string SuccessMessage { get { throw null; } set { } }
100+
public bool? UseEmbeddedWebView { get { throw null; } set { } }
101101
}
102102
public partial class ChainedTokenCredential : Azure.Core.TokenCredential
103103
{
@@ -281,7 +281,7 @@ public partial class InteractiveBrowserCredentialOptions : Azure.Identity.TokenC
281281
public InteractiveBrowserCredentialOptions() { }
282282
public System.Collections.Generic.IList<string> AdditionallyAllowedTenants { get { throw null; } }
283283
public Azure.Identity.AuthenticationRecord AuthenticationRecord { get { throw null; } set { } }
284-
public Azure.Identity.BrowserCustomizationOptions BrowserCustomizedOptions { get { throw null; } set { } }
284+
public Azure.Identity.BrowserCustomizationOptions BrowserCustomization { get { throw null; } set { } }
285285
public string ClientId { get { throw null; } set { } }
286286
public bool DisableAutomaticAuthentication { get { throw null; } set { } }
287287
public bool DisableInstanceDiscovery { get { throw null; } set { } }

sdk/identity/Azure.Identity/src/Credentials/BrowserCustomizationOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class BrowserCustomizationOptions
1717
/// Specifies if the public client application should used an embedded web browser
1818
/// or the system default browser
1919
/// </summary>
20-
public bool? UseEmbeddedWebView;
20+
public bool? UseEmbeddedWebView { get; set; }
2121

2222
internal SystemWebViewOptions SystemBrowserOptions;
2323

@@ -34,7 +34,7 @@ private SystemWebViewOptions systemWebViewOptions
3434
/// Property to set HtmlMessageSuccess of SystemWebViewOptions from MSAL,
3535
/// which the browser will show to the user when the user finishes authenticating successfully.
3636
/// </summary>
37-
public string HtmlMessageSuccess
37+
public string SuccessMessage
3838
{
3939
get
4040
{
@@ -52,7 +52,7 @@ public string HtmlMessageSuccess
5252
/// which the browser will show to the user when the user finishes authenticating, but an error occurred.
5353
/// You can use a string format e.g. "An error has occurred: {0} details: {1}".
5454
/// </summary>
55-
public string HtmlMessageError
55+
public string ErrorMessage
5656
{
5757
get
5858
{

sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredential.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class InteractiveBrowserCredential : TokenCredential
2121
internal string[] AdditionallyAllowedTenantIds { get; }
2222
internal string ClientId { get; }
2323
internal string LoginHint { get; }
24-
internal BrowserCustomizationOptions BrowserCustomizedOptions { get; }
24+
internal BrowserCustomizationOptions BrowserCustomization { get; }
2525
internal MsalPublicClient Client { get; }
2626
internal CredentialPipeline Pipeline { get; }
2727
internal bool DisableAutomaticAuthentication { get; }
@@ -91,7 +91,7 @@ internal InteractiveBrowserCredential(string tenantId, string clientId, TokenCre
9191
Client = client ?? new MsalPublicClient(Pipeline, tenantId, clientId, redirectUrl, options);
9292
AdditionallyAllowedTenantIds = TenantIdResolver.ResolveAddionallyAllowedTenantIds((options as ISupportsAdditionallyAllowedTenants)?.AdditionallyAllowedTenants);
9393
Record = (options as InteractiveBrowserCredentialOptions)?.AuthenticationRecord;
94-
BrowserCustomizedOptions = (options as InteractiveBrowserCredentialOptions)?.BrowserCustomizedOptions;
94+
BrowserCustomization = (options as InteractiveBrowserCredentialOptions)?.BrowserCustomization;
9595
}
9696

9797
/// <summary>
@@ -242,7 +242,7 @@ private async Task<AccessToken> GetTokenViaBrowserLoginAsync(TokenRequestContext
242242

243243
var tenantId = TenantIdResolver.Resolve(TenantId ?? Record?.TenantId, context, AdditionallyAllowedTenantIds);
244244
AuthenticationResult result = await Client
245-
.AcquireTokenInteractiveAsync(context.Scopes, context.Claims, prompt, LoginHint, tenantId, context.IsCaeEnabled, BrowserCustomizedOptions, async, cancellationToken)
245+
.AcquireTokenInteractiveAsync(context.Scopes, context.Claims, prompt, LoginHint, tenantId, context.IsCaeEnabled, BrowserCustomization, async, cancellationToken)
246246
.ConfigureAwait(false);
247247

248248
Record = new AuthenticationRecord(result, ClientId);

sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredentialOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ public string TenantId
6969
/// <summary>
7070
/// The options for customizing the browser for interactive authentication.
7171
/// </summary>
72-
public BrowserCustomizationOptions BrowserCustomizedOptions { get; set; }
72+
public BrowserCustomizationOptions BrowserCustomization { get; set; }
7373
}
7474
}

sdk/identity/Azure.Identity/tests/InteractiveBrowserCredentialTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,25 +294,25 @@ public async Task InvokesBeforeBuildClientOnExtendedOptions()
294294
}
295295

296296
[Test]
297-
public async Task BrowserCustomizedOptionsHtmlMessage([Values(null, "<p> Login Successfully.</p>")] string htmlMessageSuccess, [Values(null, "<p> An error occured: {0}. Details {1}</p>")] string htmlMessageError)
297+
public async Task BrowserCustomizationsHtmlMessage([Values(null, "<p> Login Successfully.</p>")] string htmlMessageSuccess, [Values(null, "<p> An error occured: {0}. Details {1}</p>")] string htmlMessageError)
298298
{
299299
var mockMsalClient = new MockMsalPublicClient
300300
{
301301
InteractiveAuthFactory = (_, _, _, _, _, _, browserOptions, _) =>
302302
{
303303
Assert.AreEqual(false, browserOptions.UseEmbeddedWebView);
304-
Assert.AreEqual(htmlMessageSuccess, browserOptions.HtmlMessageSuccess);
305-
Assert.AreEqual(htmlMessageError, browserOptions.HtmlMessageError);
304+
Assert.AreEqual(htmlMessageSuccess, browserOptions.SuccessMessage);
305+
Assert.AreEqual(htmlMessageError, browserOptions.ErrorMessage);
306306
return AuthenticationResultFactory.Create(Guid.NewGuid().ToString(), expiresOn: DateTimeOffset.UtcNow.AddMinutes(5));
307307
}
308308
};
309309
var options = new InteractiveBrowserCredentialOptions()
310310
{
311-
BrowserCustomizedOptions = new BrowserCustomizationOptions()
311+
BrowserCustomization = new BrowserCustomizationOptions()
312312
{
313313
UseEmbeddedWebView = false,
314-
HtmlMessageSuccess = htmlMessageSuccess,
315-
HtmlMessageError = htmlMessageError
314+
SuccessMessage = htmlMessageSuccess,
315+
ErrorMessage = htmlMessageError
316316
}
317317
};
318318

@@ -329,16 +329,16 @@ public async Task BrowserCustomizedUseEmbeddedWebView([Values(null, true, false)
329329
InteractiveAuthFactory = (_, _, _, _, _, _, browserOptions, _) =>
330330
{
331331
Assert.AreEqual(useEmbeddedWebView, browserOptions.UseEmbeddedWebView);
332-
Assert.AreEqual(htmlMessageError, browserOptions.HtmlMessageError);
332+
Assert.AreEqual(htmlMessageError, browserOptions.ErrorMessage);
333333
return AuthenticationResultFactory.Create(Guid.NewGuid().ToString(), expiresOn: DateTimeOffset.UtcNow.AddMinutes(5));
334334
}
335335
};
336336
var options = new InteractiveBrowserCredentialOptions()
337337
{
338-
BrowserCustomizedOptions = new BrowserCustomizationOptions()
338+
BrowserCustomization = new BrowserCustomizationOptions()
339339
{
340340
UseEmbeddedWebView = useEmbeddedWebView,
341-
HtmlMessageError = htmlMessageError
341+
ErrorMessage = htmlMessageError
342342
}
343343
};
344344

0 commit comments

Comments
 (0)