Skip to content

Commit

Permalink
update to msal 4.37.0-preview (#1479)
Browse files Browse the repository at this point in the history
* update to msal 4.37.0-preview

* re-add msal to tool project
  • Loading branch information
jennyf19 authored Oct 6, 2021
1 parent 2729101 commit 9126e50
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client" Version="4.36.2" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.37.0-preview" />

<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.205">
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client" Version="4.36.2" />

<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.205">
<PrivateAssets>all</PrivateAssets>
Expand Down
15 changes: 13 additions & 2 deletions src/Microsoft.Identity.Web/TokenAcquisition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using Microsoft.Extensions.Primitives;
using Microsoft.Identity.Client;
using Microsoft.Identity.Web.TokenCacheProviders;
using Microsoft.Identity.Web.TokenCacheProviders.InMemory;
using Microsoft.Net.Http.Headers;

namespace Microsoft.Identity.Web
Expand Down Expand Up @@ -693,6 +694,11 @@ private IConfidentialClientApplication BuildConfidentialClientApplication(Merged
enablePiiLogging: mergedOptions.ConfidentialClientApplicationOptions.EnablePiiLogging)
.WithExperimentalFeatures();

if (_tokenCacheProvider is MsalMemoryTokenCacheProvider)
{
builder.WithCacheOptions(CacheOptions.EnableSharedCacheOptions);
}

// The redirect URI is not needed for OBO
if (!string.IsNullOrEmpty(currentUri))
{
Expand Down Expand Up @@ -731,9 +737,14 @@ private IConfidentialClientApplication BuildConfidentialClientApplication(Merged

IConfidentialClientApplication app = builder.Build();
_application = app;

// Initialize token cache providers
_tokenCacheProvider.Initialize(app.AppTokenCache);
_tokenCacheProvider.Initialize(app.UserTokenCache);
if (!(_tokenCacheProvider is MsalMemoryTokenCacheProvider))
{
_tokenCacheProvider.Initialize(app.AppTokenCache);
_tokenCacheProvider.Initialize(app.UserTokenCache);
}

return app;
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
<Compile Include="..\..\src\Microsoft.Identity.Web\MicrosoftIdentityOptions.cs" Link="OptionClasses\MicrosoftIdentityOptions.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.36.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0-*" />
Expand All @@ -33,6 +29,10 @@
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.37.0-preview" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Identity.Web.Certificate\Microsoft.Identity.Web.Certificate.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 9126e50

Please sign in to comment.