Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit b4fee93

Browse files
committed
Migrate Owin.Security.OAuth.Introspection and Owin.Security.OAuth.Validation to Katana 4 and IdentityModel 5
1 parent a9d5170 commit b4fee93

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<packageSources>
44
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
55
<add key="aspnetcore" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
6+
<add key="aspnetkatana" value="https://dotnet.myget.org/F/katana-dev/api/v3/index.json" />
67
<add key="aspnet-contrib" value="https://www.myget.org/F/aspnet-contrib/api/v3/index.json" />
78
</packageSources>
89
</configuration>

build/dependencies.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
<PropertyGroup>
44
<AspNetCoreVersion>2.0.0-*</AspNetCoreVersion>
55
<CoreFxVersion>4.4.0-*</CoreFxVersion>
6-
<IdentityModelVersion>1.0.4.403061554</IdentityModelVersion>
76
<IdentityModelCoreVersion>2.1.3-*</IdentityModelCoreVersion>
87
<JetBrainsVersion>10.3.0</JetBrainsVersion>
98
<JsonNetVersion>10.0.2</JsonNetVersion>
109
<MoqVersion>4.7.63</MoqVersion>
1110
<NetHttpVersion>4.3.2</NetHttpVersion>
1211
<NetStandardImplicitPackageVersion>2.0.0-*</NetStandardImplicitPackageVersion>
1312
<NetStandardLibraryNetFrameworkVersion>2.0.0-*</NetStandardLibraryNetFrameworkVersion>
14-
<OwinVersion>3.0.1</OwinVersion>
13+
<OwinVersion>4.0.0-*</OwinVersion>
1514
<RuntimeFrameworkVersion>2.0.0-*</RuntimeFrameworkVersion>
1615
<TestSdkVersion>15.3.0-*</TestSdkVersion>
1716
<XunitVersion>2.3.0-*</XunitVersion>

src/Owin.Security.OAuth.Introspection/OAuthIntrospectionConfiguration.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Threading.Tasks;
1111
using JetBrains.Annotations;
1212
using Microsoft.IdentityModel.Protocols;
13+
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
1314
using Newtonsoft.Json;
1415

1516
namespace Owin.Security.OAuth.Introspection
@@ -31,10 +32,7 @@ public OAuthIntrospectionConfiguration()
3132
/// </summary>
3233
/// <param name="json">The JSON payload used to initialize the current instance.</param>
3334
public OAuthIntrospectionConfiguration([NotNull] string json)
34-
: base(json)
35-
{
36-
JsonConvert.PopulateObject(json, this);
37-
}
35+
: base(json) { }
3836

3937
/// <summary>
4038
/// Gets or sets the introspection endpoint address.

src/Owin.Security.OAuth.Introspection/OAuthIntrospectionMiddleware.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,9 @@ public OAuthIntrospectionMiddleware(
141141
"'RequireHttpsMetadata' is not set to 'false'.", nameof(options));
142142
}
143143

144-
Options.ConfigurationManager = new ConfigurationManager<OAuthIntrospectionConfiguration>(
145-
Options.MetadataAddress.AbsoluteUri, new OAuthIntrospectionConfiguration.Retriever(),
146-
(IDocumentRetriever) Activator.CreateInstance(
147-
type: typeof(OpenIdConnectConfiguration).Assembly.GetType("Microsoft.IdentityModel.Protocols.HttpDocumentRetriever"),
148-
args: Options.HttpClient));
144+
options.ConfigurationManager = new ConfigurationManager<OAuthIntrospectionConfiguration>(
145+
options.MetadataAddress.AbsoluteUri, new OAuthIntrospectionConfiguration.Retriever(),
146+
new HttpDocumentRetriever(options.HttpClient) { RequireHttps = options.RequireHttpsMetadata });
149147
}
150148
}
151149
}

src/Owin.Security.OAuth.Introspection/Owin.Security.OAuth.Introspection.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@
1616
<PackageReference Include="JetBrains.Annotations" Version="$(JetBrainsVersion)" PrivateAssets="All" />
1717
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(AspNetCoreVersion)" />
1818
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(AspNetCoreVersion)" />
19-
<PackageReference Include="Microsoft.IdentityModel.Protocol.Extensions" Version="$(IdentityModelVersion)" />
19+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(IdentityModelCoreVersion)" />
2020
<PackageReference Include="Microsoft.Owin.Security.Interop" Version="$(AspNetCoreVersion)" />
2121
<PackageReference Include="Newtonsoft.Json" Version="$(JsonNetVersion)" />
2222
<PackageReference Include="System.Net.Http" Version="$(NetHttpVersion)" />
2323
</ItemGroup>
2424

25-
<ItemGroup>
26-
<Reference Include="System.IdentityModel" />
27-
</ItemGroup>
28-
2925
</Project>

0 commit comments

Comments
 (0)