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

Convert JWT library to dotnetcore #60

Closed
wants to merge 7 commits into from
Closed
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ _ReSharper*/
package/
packages/
*.nupkg
.idea
project.lock.json
13 changes: 0 additions & 13 deletions JWT.nuspec

This file was deleted.

25 changes: 10 additions & 15 deletions JWT.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JWT", "src\JWT\JWT.csproj", "{A80B51B8-DDF6-4026-98A4-B59653E50B38}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{513CE2B5-E0D6-43BC-998A-A02CB2875479}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JWT.Tests", "tests\JWT.Tests\JWT.Tests.csproj", "{BF568781-D576-4545-A552-4DC839B1AF14}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JWT", "src\JWT\JWT.xproj", "{00000000-0000-0000-0000-000000000000}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why it's empty guid now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to double check. I updated the solution using project rider so im not 100% confident it is correct. I don't actually have VS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to compile in VS2015 once get access to my dev vm

EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{513CE2B5-E0D6-43BC-998A-A02CB2875479}"
ProjectSection(SolutionItems) = preProject
JWT.nuspec = JWT.nuspec
package.cmd = package.cmd
EndProjectSection
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JWT.Tests", "tests\JWT.Tests\JWT.Tests.xproj", "{00000000-0000-0000-0000-000000000000}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A80B51B8-DDF6-4026-98A4-B59653E50B38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A80B51B8-DDF6-4026-98A4-B59653E50B38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A80B51B8-DDF6-4026-98A4-B59653E50B38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A80B51B8-DDF6-4026-98A4-B59653E50B38}.Release|Any CPU.Build.0 = Release|Any CPU
{BF568781-D576-4545-A552-4DC839B1AF14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF568781-D576-4545-A552-4DC839B1AF14}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF568781-D576-4545-A552-4DC839B1AF14}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF568781-D576-4545-A552-4DC839B1AF14}.Release|Any CPU.Build.0 = Release|Any CPU
{00000000-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00000000-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00000000-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00000000-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"projects":[ "src", "tests" ]
}
11 changes: 0 additions & 11 deletions package.cmd

This file was deleted.

7 changes: 5 additions & 2 deletions src/JWT/DefaultJsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Web.Script.Serialization;
#if !NETSTANDARD1_3

using System.Web.Script.Serialization;

namespace JWT
{
Expand Down Expand Up @@ -30,4 +32,5 @@ public T Deserialize<T>(string json)
return serializer.Deserialize<T>(json);
}
}
}
}
#endif
6 changes: 5 additions & 1 deletion src/JWT/JWT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ public static class JsonWebToken
/// <summary>
/// Pluggable JSON Serializer
/// </summary>
#if !NETSTANDARD1_3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should jump 2.0 and make this change for either platforms

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im assuming you mean BOTH platforms. I will make this change then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, right

public static IJsonSerializer JsonSerializer = new DefaultJsonSerializer();
#else
public static IJsonSerializer JsonSerializer = new NewtonsoftJsonSerializer();
#endif

private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);

Expand Down Expand Up @@ -293,4 +297,4 @@ private static JwtHashAlgorithm GetHashAlgorithm(string algorithm)
}
}
}
}
}
57 changes: 0 additions & 57 deletions src/JWT/JWT.csproj

This file was deleted.

19 changes: 19 additions & 0 deletions src/JWT/JWT.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>ac42b95c-6cf7-4ac8-8baf-91bbad616fbc</ProjectGuid>
<RootNamespace>JWT</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
20 changes: 20 additions & 0 deletions src/JWT/NewtonsoftJsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#if NETSTANDARD1_3

namespace JWT
{
using Newtonsoft.Json;

public class NewtonsoftJsonSerializer : IJsonSerializer
{
public string Serialize(object obj)
{
return JsonConvert.SerializeObject(obj);
}

public T Deserialize<T>(string json)
{
return JsonConvert.DeserializeObject<T>(json);
}
}
}
#endif
48 changes: 48 additions & 0 deletions src/JWT/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"version": "1.3.7-beta1",
"title": "JWT",
"description": "JWT (JSON Web Token) implemented for .NET",
"authors": [
"John Sheehan",
"Michael Lehenbauer",
"Alexander Batishchev",
"Alistair Bush"
],

"packOptions": {
"projectUrl": "https://github.com/jwt-dotnet/jwt",
"tags": [
"json",
"jwt"
],
"licenseUrl": "https://github.com/jwt-dotnet/jwt/blob/master/LICENSE.txt",
"repository": {
"type": "git",
"url": "[email protected]:jwt-dotnet/jwt.git"
}
},

"dependencies": {
"NETStandard.Library": "1.6.0"
},

"frameworks": {
"net35": {
"frameworkAssemblies": {
"System": "",
"System.Core": "",
"System.Web.Extensions": ""
}
},
"netstandard1.3": {
"dependencies": {
"Newtonsoft.Json": "9.0.1",
"System.Security.Cryptography.Algorithms": "4.2.0"
}
}
},

"tooling": {
"defaultNamespace": "JWT"
}
}
Loading