Skip to content

Commit b389ee1

Browse files
authored
Merge pull request #65 from Azure-Samples/jenny/msal4.24
update to msal 4.24
2 parents 03490ae + 815389b commit b389ee1

3 files changed

Lines changed: 34 additions & 15 deletions

File tree

active-directory-b2c-wpf/App.xaml.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ public partial class App : Application
2929
/// <summary>
3030
/// Should be one of the choices on the Azure AD B2c / [This App] / Authentication blade
3131
/// </summary>
32-
private static readonly string RedirectUri = "https://fabrikamb2c.b2clogin.com/oauth2/nativeclient";
32+
private static readonly string RedirectUri = $"https://{AzureAdB2CHostname}/oauth2/nativeclient";
3333

3434
/// <summary>
3535
/// From Azure AD B2C / UserFlows blade
3636
/// </summary>
37-
public static string PolicySignUpSignIn = "b2c_1_susi";
38-
public static string PolicyEditProfile = "b2c_1_edit_profile";
39-
public static string PolicyResetPassword = "b2c_1_reset";
37+
public const string PolicySignUpSignIn = "b2c_1_susi";
38+
public const string PolicyEditProfile = "b2c_1_edit_profile";
39+
public const string PolicyResetPassword = "b2c_1_reset";
4040

4141
/// <summary>
4242
/// 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
4545
/// 2nd: Azure AD B2C / App registrations / [This App] / API Permissions / Add a permission / My APIs / [API App] / Select & Add Permissions
4646
/// 3rd: Azure AD B2C / App registrations / [This App] / API Permissions / ... (next to add a permission) / Grant Admin Consent for [tenant]
4747
/// </summary>
48-
public static string[] ApiScopes = { "https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read" };
48+
public static readonly string[] ApiScopes = { "https://fabrikamb2c.onmicrosoft.com/helloapi/demo.read" };
4949

5050
/// <summary>
5151
/// URL for API which will receive the bearer token corresponding to this authentication
5252
/// </summary>
53-
public static string ApiEndpoint = "https://fabrikamb2chello.azurewebsites.net/hello";
53+
public static readonly string ApiEndpoint = "https://fabrikamb2chello.azurewebsites.net/hello";
5454

5555
// Shouldn't need to change these:
56-
private static string AuthorityBase = $"https://{AzureAdB2CHostname}/tfp/{Tenant}/";
57-
public static string AuthoritySignUpSignIn = $"{AuthorityBase}{PolicySignUpSignIn}";
58-
public static string AuthorityEditProfile = $"{AuthorityBase}{PolicyEditProfile}";
59-
public static string AuthorityResetPassword = $"{AuthorityBase}{PolicyResetPassword}";
56+
private static readonly string AuthorityBase = $"https://{AzureAdB2CHostname}/tfp/{Tenant}/";
57+
public static readonly string AuthoritySignUpSignIn = $"{AuthorityBase}{PolicySignUpSignIn}";
58+
public static readonly string AuthorityEditProfile = $"{AuthorityBase}{PolicyEditProfile}";
59+
public static readonly string AuthorityResetPassword = $"{AuthorityBase}{PolicyResetPassword}";
6060

6161
public static IPublicClientApplication PublicClientApp { get; private set; }
6262

active-directory-b2c-wpf/active-directory-b2c-wpf.csproj

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.props" Condition="Exists('..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.props')" />
34
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
45
<PropertyGroup>
56
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -14,6 +15,8 @@
1415
<WarningLevel>4</WarningLevel>
1516
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1617
<TargetFrameworkProfile />
18+
<NuGetPackageImportStamp>
19+
</NuGetPackageImportStamp>
1720
</PropertyGroup>
1821
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1922
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -35,9 +38,11 @@
3538
<WarningLevel>4</WarningLevel>
3639
</PropertyGroup>
3740
<ItemGroup>
38-
<Reference Include="Microsoft.Identity.Client, Version=4.22.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Microsoft.Identity.Client.4.22.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
40-
</Reference>
41+
<PackageReference Include="Microsoft.Identity.Client">
42+
<Version>4.23.0</Version>
43+
</PackageReference>
44+
</ItemGroup>
45+
<ItemGroup>
4146
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4247
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
4348
</Reference>
@@ -97,7 +102,6 @@
97102
<Generator>ResXFileCodeGenerator</Generator>
98103
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
99104
</EmbeddedResource>
100-
<None Include="packages.config" />
101105
<None Include="Properties\Settings.settings">
102106
<Generator>SettingsSingleFileGenerator</Generator>
103107
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -107,4 +111,16 @@
107111
<None Include="App.config" />
108112
</ItemGroup>
109113
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114+
<Import Project="..\packages\System.Runtime.WindowsRuntime.4.6.0\build\net461\System.Runtime.WindowsRuntime.targets" Condition="Exists('..\packages\System.Runtime.WindowsRuntime.4.6.0\build\net461\System.Runtime.WindowsRuntime.targets')" />
115+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
116+
<PropertyGroup>
117+
<ErrorText>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}.</ErrorText>
118+
</PropertyGroup>
119+
<Error Condition="!Exists('..\packages\System.Runtime.WindowsRuntime.4.6.0\build\net461\System.Runtime.WindowsRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Runtime.WindowsRuntime.4.6.0\build\net461\System.Runtime.WindowsRuntime.targets'))" />
120+
<Error Condition="!Exists('..\packages\System.Runtime.WindowsRuntime.UI.Xaml.4.6.0\build\net461\System.Runtime.WindowsRuntime.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Runtime.WindowsRuntime.UI.Xaml.4.6.0\build\net461\System.Runtime.WindowsRuntime.UI.Xaml.targets'))" />
121+
<Error Condition="!Exists('..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.props'))" />
122+
<Error Condition="!Exists('..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.targets'))" />
123+
</Target>
124+
<Import Project="..\packages\System.Runtime.WindowsRuntime.UI.Xaml.4.6.0\build\net461\System.Runtime.WindowsRuntime.UI.Xaml.targets" Condition="Exists('..\packages\System.Runtime.WindowsRuntime.UI.Xaml.4.6.0\build\net461\System.Runtime.WindowsRuntime.UI.Xaml.targets')" />
125+
<Import Project="..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.targets" Condition="Exists('..\packages\Microsoft.Windows.SDK.Contracts.10.0.17763.1000\build\Microsoft.Windows.SDK.Contracts.targets')" />
110126
</Project>
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Identity.Client" version="4.22.0" targetFramework="net472" />
3+
<package id="Microsoft.Identity.Client" version="4.24.0" targetFramework="net472" />
44
<package id="Microsoft.NETCore.Platforms" version="1.1.1" targetFramework="net452" />
55
<package id="Microsoft.NETCore.Targets" version="1.1.3" targetFramework="net452" />
6+
<package id="Microsoft.Windows.SDK.Contracts" version="10.0.17763.1000" targetFramework="net472" />
67
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net452" />
78
<package id="System.Private.Uri" version="4.3.2" targetFramework="net452" />
9+
<package id="System.Runtime.WindowsRuntime" version="4.6.0" targetFramework="net472" />
10+
<package id="System.Runtime.WindowsRuntime.UI.Xaml" version="4.6.0" targetFramework="net472" />
811
</packages>

0 commit comments

Comments
 (0)