From 815389b5a88070d400bbb062b46fbc87d7ec8023 Mon Sep 17 00:00:00 2001 From: Jennyf19 Date: Thu, 3 Dec 2020 17:50:00 -0800 Subject: [PATCH] update to msal 4.24 --- active-directory-b2c-wpf/App.xaml.cs | 20 ++++++++-------- .../active-directory-b2c-wpf.csproj | 24 +++++++++++++++---- active-directory-b2c-wpf/packages.config | 5 +++- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/active-directory-b2c-wpf/App.xaml.cs b/active-directory-b2c-wpf/App.xaml.cs index 578c49e..8d920eb 100644 --- a/active-directory-b2c-wpf/App.xaml.cs +++ b/active-directory-b2c-wpf/App.xaml.cs @@ -29,14 +29,14 @@ public partial class App : Application /// /// Should be one of the choices on the Azure AD B2c / [This App] / Authentication blade /// - private static readonly string RedirectUri = "https://fabrikamb2c.b2clogin.com/oauth2/nativeclient"; + private static readonly string RedirectUri = $"https://{AzureAdB2CHostname}/oauth2/nativeclient"; /// /// From Azure AD B2C / UserFlows blade /// - public static string PolicySignUpSignIn = "b2c_1_susi"; - public static string PolicyEditProfile = "b2c_1_edit_profile"; - public static string PolicyResetPassword = "b2c_1_reset"; + public const string PolicySignUpSignIn = "b2c_1_susi"; + public const string PolicyEditProfile = "b2c_1_edit_profile"; + public const string PolicyResetPassword = "b2c_1_reset"; /// /// Note: AcquireTokenInteractive will fail to get the AccessToken if "Admin Consent" has not been granted to this scope. To achieve this: @@ -45,18 +45,18 @@ public partial class App : Application /// 2nd: Azure AD B2C / App registrations / [This App] / API Permissions / Add a permission / My APIs / [API App] / Select & Add Permissions /// 3rd: Azure AD B2C / App registrations / [This App] / API Permissions / ... (next to add a permission) / Grant Admin Consent for [tenant] /// - public static string[] ApiScopes = { "https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read" }; + public static readonly string[] ApiScopes = { "https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read" }; /// /// URL for API which will receive the bearer token corresponding to this authentication /// - public static string ApiEndpoint = "https://fabrikamb2chello.azurewebsites.net/hello"; + public static readonly string ApiEndpoint = "https://fabrikamb2chello.azurewebsites.net/hello"; // Shouldn't need to change these: - private static string AuthorityBase = $"https://{AzureAdB2CHostname}/tfp/{Tenant}/"; - public static string AuthoritySignUpSignIn = $"{AuthorityBase}{PolicySignUpSignIn}"; - public static string AuthorityEditProfile = $"{AuthorityBase}{PolicyEditProfile}"; - public static string AuthorityResetPassword = $"{AuthorityBase}{PolicyResetPassword}"; + private static readonly string AuthorityBase = $"https://{AzureAdB2CHostname}/tfp/{Tenant}/"; + public static readonly string AuthoritySignUpSignIn = $"{AuthorityBase}{PolicySignUpSignIn}"; + public static readonly string AuthorityEditProfile = $"{AuthorityBase}{PolicyEditProfile}"; + public static readonly string AuthorityResetPassword = $"{AuthorityBase}{PolicyResetPassword}"; public static IPublicClientApplication PublicClientApp { get; private set; } diff --git a/active-directory-b2c-wpf/active-directory-b2c-wpf.csproj b/active-directory-b2c-wpf/active-directory-b2c-wpf.csproj index 59977e2..902db2d 100644 --- a/active-directory-b2c-wpf/active-directory-b2c-wpf.csproj +++ b/active-directory-b2c-wpf/active-directory-b2c-wpf.csproj @@ -1,5 +1,6 @@  + Debug @@ -14,6 +15,8 @@ 4 true + + AnyCPU @@ -35,9 +38,11 @@ 4 - - ..\packages\Microsoft.Identity.Client.4.22.0\lib\net461\Microsoft.Identity.Client.dll - + + 4.23.0 + + + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll @@ -97,7 +102,6 @@ ResXFileCodeGenerator Resources.Designer.cs - SettingsSingleFileGenerator Settings.Designer.cs @@ -107,4 +111,16 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + \ No newline at end of file diff --git a/active-directory-b2c-wpf/packages.config b/active-directory-b2c-wpf/packages.config index 5aec6dd..16e1827 100644 --- a/active-directory-b2c-wpf/packages.config +++ b/active-directory-b2c-wpf/packages.config @@ -1,8 +1,11 @@  - + + + + \ No newline at end of file