Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -11,20 +11,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0-preview-20220726-02" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="FluentAssertions" Version="8.8.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.Json" Version="9.0.3" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -38,7 +38,7 @@
<CodeAnalysisRuleSet>..\OktaSdk.Tests.ruleset</CodeAnalysisRuleSet>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>okta.aspnet.public.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PublicSign>true</PublicSign>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task BuildUserAgent(string frameworkName)
httpRequestMessage.Headers.UserAgent.ToString()
.IndexOf(
ProductInfoHeaderValue.Parse($"{frameworkName}/{version.Major}.{version.Minor}.{version.Build}")
.ToString(), StringComparison.InvariantCultureIgnoreCase).Should().BeGreaterOrEqualTo(0);
.ToString(), StringComparison.InvariantCultureIgnoreCase).Should().BeGreaterThanOrEqualTo(0);
}
}
}
16 changes: 8 additions & 8 deletions Okta.AspNet.Abstractions/Okta.AspNet.Abstractions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;netstandard2.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net481;net8.0;net9.0;net10.0</TargetFrameworks>
<Version>5.1.7</Version>
</PropertyGroup>

Expand All @@ -15,16 +15,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="9.0.3" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<AdditionalFiles Include="..\stylecop.json" />
</ItemGroup>

<!-- System.Runtime.InteropServices.RuntimeInformation package removed (Issue #298) -->
<!-- RuntimeInformation is available in BCL for net48, netstandard2.0, and net8.0+ -->
<!-- RuntimeInformation is available in BCL for net481, netstandard2.0, and net8.0+ -->

<ItemGroup>
<Folder Include="Properties\" />
Expand All @@ -34,7 +34,7 @@
<CodeAnalysisRuleSet>..\OktaSdk.ruleset</CodeAnalysisRuleSet>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>okta.aspnet.public.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PublicSign>true</PublicSign>
<AssemblyVersion>5.1.6.0</AssemblyVersion>
<FileVersion>5.1.6.0</FileVersion>
</PropertyGroup>
Expand Down
3 changes: 0 additions & 3 deletions Okta.AspNet.Abstractions/OktaParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,15 @@ public static class OktaParams
/// </summary>
public const string Idp = "idp";


/// <summary>
/// Used to pass acr_values.
/// </summary>
public const string AcrValues = "acr_values";


/// <summary>
/// Used to support enrollment of a factor during an /authorize call.
/// </summary>
public const string Prompt = "prompt";

/// <summary>
/// Used to pass a case-sensitive string that represents a list of authenticator method references.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Okta.AspNet.Abstractions/UserAgentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static string GetFrameworkDescription(string runtimeFrameworkDescription
{
if (string.IsNullOrEmpty(assemblyCodeBase))
{
assemblyCodeBase = typeof(System.Runtime.GCSettings).GetTypeInfo().Assembly?.CodeBase;
assemblyCodeBase = typeof(System.Runtime.GCSettings).GetTypeInfo().Assembly?.Location;
}

if (assemblyCodeBase != null)
Expand Down
28 changes: 14 additions & 14 deletions Okta.AspNet.Test/Okta.AspNet.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<TargetFramework>net481</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0-preview-20220726-02" />
<PackageReference Include="NSubstitute" Version="4.3.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="9.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="FluentAssertions" Version="8.8.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\Okta.AspNet\Okta.AspNet.csproj" />
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -35,7 +35,7 @@
<CodeAnalysisRuleSet>..\OktaSdk.Tests.ruleset</CodeAnalysisRuleSet>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>okta.aspnet.public.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PublicSign>true</PublicSign>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<TargetFramework>net481</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Okta.AspNet.WebApi.IntegrationTest</RootNamespace>
<AssemblyName>Okta.AspNet.WebApi.IntegrationTest</AssemblyName>
Expand All @@ -13,30 +13,30 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.6.0" />
<PackageReference Include="FluentAssertions" Version="8.8.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Owin" Version="5.3.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.WebHost" Version="5.3.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.Owin" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Security" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Security.OAuth" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Testing" Version="4.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.Owin" Version="4.2.3" />
<PackageReference Include="Microsoft.Owin.Hosting" Version="4.2.3" />
<PackageReference Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageReference Include="Microsoft.Owin.Security.OAuth" Version="4.2.3" />
<PackageReference Include="Microsoft.Owin.Testing" Version="4.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="Owin" Version="1.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="9.0.3" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
26 changes: 13 additions & 13 deletions Okta.AspNet/Okta.AspNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Copyright>(c) 2019 Okta, Inc.</Copyright>
<Version>3.2.11</Version>
<Authors>Okta, Inc.</Authors>
<TargetFramework>net48</TargetFramework>
<TargetFramework>net481</TargetFramework>
<AssemblyName>Okta.AspNet</AssemblyName>
<PackageId>Okta.AspNet</PackageId>
<PackageTags>okta,token,authentication,authorization,oauth,sso,oidc</PackageTags>
Expand All @@ -18,17 +18,17 @@
<ItemGroup>
<ProjectReference Include="..\Okta.AspNet.Abstractions\Okta.AspNet.Abstractions.csproj" />
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="All" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.0" />
<PackageReference Include="Microsoft.Owin.Security" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Security.Jwt" Version="4.2.2" />
<PackageReference Include="Microsoft.Owin.Security.OpenIdConnect" Version="4.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="System.Text.Json" Version="9.0.3" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />
<PackageReference Include="Microsoft.Owin.Security" Version="4.2.3" />
<PackageReference Include="Microsoft.Owin.Security.Jwt" Version="4.2.3" />
<PackageReference Include="Microsoft.Owin.Security.OpenIdConnect" Version="4.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<AdditionalFiles Include="..\stylecop.json" />
</ItemGroup>

Expand All @@ -38,7 +38,7 @@
<FileVersion>3.2.10.0</FileVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>okta.aspnet.public.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PublicSign>true</PublicSign>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Program.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.0.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0-preview-20220726-02" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.15.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.Json" Version="9.0.3" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="10.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Okta.AspNetCore\Okta.AspNetCore.csproj" />
Expand Down
23 changes: 16 additions & 7 deletions Okta.AspNetCore.Mvc.IntegrationTest/OktaMiddlewareShould.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using System;
using System.Net.Http;
using System.Threading.Tasks;
Expand All @@ -9,9 +10,10 @@

namespace Okta.AspNetCore.Mvc.IntegrationTest
{
public class OktaMiddlewareShould : IDisposable
public sealed class OktaMiddlewareShould : IDisposable
{
private readonly TestServer _server;
private readonly IHost _host;

private string BaseUrl { get; set; }

Expand All @@ -24,12 +26,18 @@ public OktaMiddlewareShould()
Configuration = TestConfiguration.GetConfiguration();
BaseUrl = "http://localhost:57451";
ProtectedEndpoint = string.Format("{0}/Account/Claims", BaseUrl);
_server = new TestServer(new WebHostBuilder()
.UseStartup<Startup>()
.UseConfiguration(Configuration))
{
BaseAddress = new Uri(BaseUrl),
};

_host = Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseStartup<Startup>()
.UseConfiguration(Configuration);
})
.Build();

_server = _host.GetTestServer();
_server.BaseAddress = new Uri(BaseUrl);
}

[Fact]
Expand Down Expand Up @@ -109,6 +117,7 @@ public async Task CallCustomRedirectEventAfterInternalEventAsync()
public void Dispose()
{
_server.Dispose();
_host.Dispose();
}
}
}
Loading