Skip to content

Commit 7e300c7

Browse files
author
Kalyan Krishna
authored
Merge pull request #28 from Shama-K/complete
Updated Nuget Packages
2 parents 1442d8c + a688f0a commit 7e300c7

8 files changed

Lines changed: 69 additions & 48 deletions

File tree

AppCreationScripts/sample.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
"ManualSteps": [
4343
{
4444
"Comment": "Navigate to the Manifest page and change 'signInAudience' to 'AzureADandPersonalMicrosoftAccount'."
45+
},
46+
{
47+
"Comment": "Still in the Manifest page, change 'accessTokenAcceptedVersion' to 2 "
4548
}
4649
]
4750
}

TodoListClient/TodoListClient.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@
109109
</ItemGroup>
110110
<ItemGroup>
111111
<PackageReference Include="Microsoft.Identity.Client">
112-
<Version>4.7.1</Version>
112+
<Version>4.23.0</Version>
113113
</PackageReference>
114114
<PackageReference Include="Newtonsoft.Json">
115-
<Version>6.0.4</Version>
115+
<Version>12.0.3</Version>
116116
</PackageReference>
117117
</ItemGroup>
118118
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

TodoListService/App_Start/OpenIdConnectSecurityTokenProvider.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
using System.Collections.Generic;
2-
using System.IdentityModel.Tokens;
32
using System.Threading;
43
using Microsoft.IdentityModel.Protocols;
4+
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
5+
using Microsoft.IdentityModel.Tokens;
56
using Microsoft.Owin.Security.Jwt;
67

78
namespace TodoListService
89
{
910
// This class is necessary because the OAuthBearer Middleware does not leverage
1011
// the OpenID Connect metadata endpoint exposed by the STS by default.
1112

12-
public class OpenIdConnectSecurityTokenProvider : IIssuerSecurityTokenProvider
13+
public class OpenIdConnectSecurityKeyProvider : IIssuerSecurityKeyProvider
1314
{
1415
public ConfigurationManager<OpenIdConnectConfiguration> ConfigManager;
1516
private string _issuer;
16-
private IEnumerable<SecurityToken> _tokens;
17+
private ICollection<SecurityKey> _keys;
1718
private readonly string _metadataEndpoint;
1819

1920
private readonly ReaderWriterLockSlim _synclock = new ReaderWriterLockSlim();
2021

21-
public OpenIdConnectSecurityTokenProvider(string metadataEndpoint)
22+
public OpenIdConnectSecurityKeyProvider(string metadataEndpoint)
2223
{
2324
_metadataEndpoint = metadataEndpoint;
24-
ConfigManager = new ConfigurationManager<OpenIdConnectConfiguration>(metadataEndpoint);
25+
ConfigManager = new ConfigurationManager<OpenIdConnectConfiguration>(metadataEndpoint, new OpenIdConnectConfigurationRetriever());
2526

2627
RetrieveMetadata();
2728
}
@@ -55,15 +56,15 @@ public string Issuer
5556
/// <value>
5657
/// All known security tokens.
5758
/// </value>
58-
public IEnumerable<SecurityToken> SecurityTokens
59+
public IEnumerable<SecurityKey> SecurityKeys
5960
{
6061
get
6162
{
6263
RetrieveMetadata();
6364
_synclock.EnterReadLock();
6465
try
6566
{
66-
return _tokens;
67+
return _keys;
6768
}
6869
finally
6970
{
@@ -79,7 +80,7 @@ private void RetrieveMetadata()
7980
{
8081
OpenIdConnectConfiguration config = ConfigManager.GetConfigurationAsync().Result;
8182
_issuer = config.Issuer;
82-
_tokens = config.SigningTokens;
83+
_keys = config.SigningKeys;
8384
}
8485
finally
8586
{

TodoListService/App_Start/Startup.Auth.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Linq;
5-
using Microsoft.Owin.Security;
1+
using System.Configuration;
62
using Owin;
7-
using System.IdentityModel.Tokens;
83
using Microsoft.Owin.Security.Jwt;
94
using Microsoft.Owin.Security.OAuth;
5+
using Microsoft.IdentityModel.Tokens;
106

117
namespace TodoListService
128
{
@@ -35,7 +31,7 @@ public void ConfigureAuth(IAppBuilder app)
3531
ValidateIssuer = false,
3632

3733
},
38-
new OpenIdConnectSecurityTokenProvider("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
34+
new OpenIdConnectSecurityKeyProvider("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
3935
),
4036
});
4137
}

TodoListService/Areas/HelpPage/Views/Web.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</configSections>
1010

1111
<system.web.webPages.razor>
12-
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
12+
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
1313
<pages pageBaseType="System.Web.Mvc.WebViewPage">
1414
<namespaces>
1515
<add namespace="System.Web.Mvc" />

TodoListService/TodoListService.csproj

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,41 @@
4646
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
4747
</Reference>
4848
<Reference Include="Microsoft.CSharp" />
49-
<Reference Include="Microsoft.IdentityModel.Protocol.Extensions, Version=1.0.40306.1554, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50-
<HintPath>..\packages\Microsoft.IdentityModel.Protocol.Extensions.1.0.4.403061554\lib\net45\Microsoft.IdentityModel.Protocol.Extensions.dll</HintPath>
49+
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50+
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.6.8.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
5151
</Reference>
52-
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53-
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
52+
<Reference Include="Microsoft.IdentityModel.Logging, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53+
<HintPath>..\packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
5454
</Reference>
55-
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56-
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
55+
<Reference Include="Microsoft.IdentityModel.Protocols, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56+
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.dll</HintPath>
5757
</Reference>
58-
<Reference Include="Microsoft.Owin.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
59-
<HintPath>..\packages\Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath>
58+
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
59+
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
6060
</Reference>
61-
<Reference Include="Microsoft.Owin.Security.Jwt, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
62-
<HintPath>..\packages\Microsoft.Owin.Security.Jwt.3.1.0\lib\net45\Microsoft.Owin.Security.Jwt.dll</HintPath>
61+
<Reference Include="Microsoft.IdentityModel.Tokens, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
62+
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll</HintPath>
6363
</Reference>
64-
<Reference Include="Microsoft.Owin.Security.OAuth, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65-
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
64+
<Reference Include="Microsoft.Owin, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<HintPath>..\packages\Microsoft.Owin.4.1.1\lib\net45\Microsoft.Owin.dll</HintPath>
66+
</Reference>
67+
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68+
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.4.1.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
69+
</Reference>
70+
<Reference Include="Microsoft.Owin.Security, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>..\packages\Microsoft.Owin.Security.4.1.1\lib\net45\Microsoft.Owin.Security.dll</HintPath>
72+
</Reference>
73+
<Reference Include="Microsoft.Owin.Security.Jwt, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
74+
<HintPath>..\packages\Microsoft.Owin.Security.Jwt.4.1.1\lib\net45\Microsoft.Owin.Security.Jwt.dll</HintPath>
75+
</Reference>
76+
<Reference Include="Microsoft.Owin.Security.OAuth, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
77+
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.4.1.1\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
6678
</Reference>
6779
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6880
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
6981
</Reference>
70-
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
71-
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
82+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
83+
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
7284
</Reference>
7385
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
7486
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
@@ -79,8 +91,8 @@
7991
<Reference Include="System.Data.Entity" />
8092
<Reference Include="System.Drawing" />
8193
<Reference Include="System.IdentityModel" />
82-
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=4.0.40306.1554, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
83-
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.4.0.4.403061554\lib\net45\System.IdentityModel.Tokens.Jwt.dll</HintPath>
94+
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
95+
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.6.8.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll</HintPath>
8496
</Reference>
8597
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8698
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
@@ -102,8 +114,8 @@
102114
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
103115
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
104116
</Reference>
105-
<Reference Include="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
106-
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.4\lib\net45\System.Web.Mvc.dll</HintPath>
117+
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
118+
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
107119
</Reference>
108120
<Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
109121
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>

TodoListService/Web.config

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</dependentAssembly>
4040
<dependentAssembly>
4141
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
42-
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
42+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
4343
</dependentAssembly>
4444
<dependentAssembly>
4545
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
@@ -51,7 +51,7 @@
5151
</dependentAssembly>
5252
<dependentAssembly>
5353
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
54-
<bindingRedirect oldVersion="0.0.0.0-4.0.40306.1554" newVersion="4.0.40306.1554" />
54+
<bindingRedirect oldVersion="0.0.0.0-6.8.0.0" newVersion="6.8.0.0" />
5555
</dependentAssembly>
5656
<dependentAssembly>
5757
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
@@ -63,7 +63,11 @@
6363
</dependentAssembly>
6464
<dependentAssembly>
6565
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
66-
<bindingRedirect oldVersion="1.0.0.0-5.2.4.0" newVersion="5.2.4.0" />
66+
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
67+
</dependentAssembly>
68+
<dependentAssembly>
69+
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
70+
<bindingRedirect oldVersion="0.0.0.0-6.8.0.0" newVersion="6.8.0.0" />
6771
</dependentAssembly>
6872
</assemblyBinding>
6973
</runtime>

TodoListService/packages.config

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,31 @@
33
<package id="Antlr" version="3.5.0.2" targetFramework="net472" />
44
<package id="bootstrap" version="3.4.1" targetFramework="net472" />
55
<package id="jQuery" version="2.1.1" targetFramework="net472" />
6-
<package id="Microsoft.AspNet.Mvc" version="5.2.4" targetFramework="net472" />
6+
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net472" />
77
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net472" />
88
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net472" />
99
<package id="Microsoft.AspNet.WebApi" version="5.2.7" targetFramework="net472" />
1010
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net472" />
1111
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net472" />
12-
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.4" targetFramework="net472" />
12+
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.7" targetFramework="net472" />
1313
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net472" />
1414
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net472" />
15+
<package id="Microsoft.IdentityModel.JsonWebTokens" version="6.8.0" targetFramework="net472" />
16+
<package id="Microsoft.IdentityModel.Logging" version="6.8.0" targetFramework="net472" />
1517
<package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.4.403061554" targetFramework="net472" />
16-
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net472" />
17-
<package id="Microsoft.Owin.Host.SystemWeb" version="3.1.0" targetFramework="net472" />
18-
<package id="Microsoft.Owin.Security" version="3.1.0" targetFramework="net472" />
19-
<package id="Microsoft.Owin.Security.Jwt" version="3.1.0" targetFramework="net472" />
20-
<package id="Microsoft.Owin.Security.OAuth" version="3.1.0" targetFramework="net472" />
18+
<package id="Microsoft.IdentityModel.Protocols" version="6.8.0" targetFramework="net472" />
19+
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.8.0" targetFramework="net472" />
20+
<package id="Microsoft.IdentityModel.Tokens" version="6.8.0" targetFramework="net472" />
21+
<package id="Microsoft.Owin" version="4.1.1" targetFramework="net472" />
22+
<package id="Microsoft.Owin.Host.SystemWeb" version="4.1.1" targetFramework="net472" />
23+
<package id="Microsoft.Owin.Security" version="4.1.1" targetFramework="net472" />
24+
<package id="Microsoft.Owin.Security.Jwt" version="4.1.1" targetFramework="net472" />
25+
<package id="Microsoft.Owin.Security.OAuth" version="4.1.1" targetFramework="net472" />
2126
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net472" />
2227
<package id="Modernizr" version="2.8.3" targetFramework="net472" />
23-
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net472" />
28+
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
2429
<package id="Owin" version="1.0" targetFramework="net472" />
2530
<package id="Respond" version="1.4.2" targetFramework="net472" />
26-
<package id="System.IdentityModel.Tokens.Jwt" version="4.0.4.403061554" targetFramework="net472" />
31+
<package id="System.IdentityModel.Tokens.Jwt" version="6.8.0" targetFramework="net472" />
2732
<package id="WebGrease" version="1.6.0" targetFramework="net472" />
2833
</packages>

0 commit comments

Comments
 (0)