-
Notifications
You must be signed in to change notification settings - Fork 321
6.0 | APIScan | MSAL WithClientName
#3360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| using System.Threading.Tasks; | ||
| using Azure.Core; | ||
| using Azure.Identity; | ||
| using Microsoft.Data.Common; | ||
| using Microsoft.Extensions.Caching.Memory; | ||
| using Microsoft.Identity.Client; | ||
| using Microsoft.Identity.Client.Extensibility; | ||
|
|
@@ -542,31 +543,24 @@ private static bool AreEqual(byte[] a1, byte[] a2) | |
|
|
||
| private IPublicClientApplication CreateClientAppInstance(PublicClientAppKey publicClientAppKey) | ||
| { | ||
| IPublicClientApplication publicClientApplication; | ||
|
|
||
| #if NETFRAMEWORK | ||
| if (_iWin32WindowFunc != null) | ||
| { | ||
| publicClientApplication = PublicClientApplicationBuilder.Create(publicClientAppKey._applicationClientId) | ||
| .WithAuthority(publicClientAppKey._authority) | ||
| .WithClientName(Common.DbConnectionStringDefaults.ApplicationName) | ||
| .WithClientVersion(Common.ADP.GetAssemblyVersion().ToString()) | ||
| .WithRedirectUri(publicClientAppKey._redirectUri) | ||
| .WithParentActivityOrWindow(_iWin32WindowFunc) | ||
| .Build(); | ||
| } | ||
| else | ||
| #endif | ||
| PublicClientApplicationBuilder builder = PublicClientApplicationBuilder | ||
| .CreateWithApplicationOptions(new PublicClientApplicationOptions | ||
| { | ||
| ClientId = publicClientAppKey._applicationClientId, | ||
| ClientName = DbConnectionStringDefaults.ApplicationName, | ||
| ClientVersion = ADP.GetAssemblyVersion().ToString(), | ||
| RedirectUri = publicClientAppKey._redirectUri, | ||
| }) | ||
| .WithAuthority(publicClientAppKey._authority); | ||
|
|
||
| #if NETFRAMEWORK | ||
| if (_iWin32WindowFunc is not null) | ||
| { | ||
| publicClientApplication = PublicClientApplicationBuilder.Create(publicClientAppKey._applicationClientId) | ||
| .WithAuthority(publicClientAppKey._authority) | ||
| .WithClientName(Common.DbConnectionStringDefaults.ApplicationName) | ||
| .WithClientVersion(Common.ADP.GetAssemblyVersion().ToString()) | ||
| .WithRedirectUri(publicClientAppKey._redirectUri) | ||
| .Build(); | ||
| builder.WithParentActivityOrWindow(_iWin32WindowFunc); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs the reassignment fix too.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦♂️
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there's anything to fix. Chaining returns the same object, not a new instance.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, after chat with @paulmedynski we are in agreement that there's nothing required here |
||
| } | ||
| #endif | ||
|
|
||
| return publicClientApplication; | ||
| return builder.Build(); | ||
| } | ||
|
|
||
| private static TokenCredentialData CreateTokenCredentialInstance(TokenCredentialKey tokenCredentialKey, string secret) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.