Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrading target framework version to .NET 3.5 #71

Merged
merged 3 commits into from
Apr 3, 2017
Merged
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
2 changes: 1 addition & 1 deletion JWT.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>JWT</id>
<version>2.1.1-beta</version>
<version>2.2.0-beta</version>
<authors>John Sheehan, Michael Lehenbauer, Alexander Batishchev</authors>
<owners>johnsheehan, devinrader, abatishchev</owners>
<description>Jwt.Net, a JWT (JSON Web Token) implementation for .NET</description>
Expand Down
4 changes: 2 additions & 2 deletions src/JWT/JWT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>JWT</RootNamespace>
<AssemblyName>JWT</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
Expand All @@ -36,7 +36,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
6 changes: 3 additions & 3 deletions src/JWT/JsonWebToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class JsonWebToken
/// </summary>
public static IJsonSerializer JsonSerializer = new JsonNetSerializer();

private static readonly Lazy<IJwtValidator> _jwtValidator = new Lazy<IJwtValidator>(() => new JwtValidator(JsonSerializer, new UtcDateTimeProvider()));
private static readonly IJwtValidator _jwtValidator = new JwtValidator(JsonSerializer, new UtcDateTimeProvider());

private static readonly AlgorithmFactory _algorithmFactory = new AlgorithmFactory();

Expand Down Expand Up @@ -103,7 +103,7 @@ public static string Decode(string token, byte[] key, bool verify = true)
{
return new JwtDecoder(
JsonSerializer,
_jwtValidator.Value)
_jwtValidator)
.Decode(token, key, verify);
}

Expand Down Expand Up @@ -177,7 +177,7 @@ public static T DecodeToObject<T>(string token, byte[] key, bool verify = true)
/// <exception cref="TokenExpiredException">The token has expired.</exception>
public static void Verify(string payloadJson, string decodedCrypto, string decodedSignature)
{
_jwtValidator.Value.Validate(payloadJson, decodedCrypto, decodedSignature);
_jwtValidator.Validate(payloadJson, decodedCrypto, decodedSignature);
}

/// <remarks>From JWT spec</remarks>
Expand Down
2 changes: 1 addition & 1 deletion src/JWT/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net35" />
</packages>