daviddesmet / paseto-dotnet

🔑 Paseto.NET, a Paseto (Platform-Agnostic Security Tokens) implementation for .NET
MIT License
94 stars 7 forks source link

Cannot find PasetoBuilder in 0.7.2 #99

Open beastlyDartfordian opened 1 year ago

beastlyDartfordian commented 1 year ago

Hi,

My project targets 4.8 so I'm trying to use version 0.7.2, however I can't find PasetoBuilder. I've tried adding "using Paseto.Builder" but that doesn't look available, and it looks like I can't move to version 1.x as they don't support dotnet 4.8 image image

Any help, advice, or steer would be greatly appreciated - Cheers

daviddesmet commented 1 year ago

Hi @beastlyDartfordian

Back in 0.7.2 the way to create tokens is like:

var token = new PasetoBuilder<Version2>()
        .WithKey(privateKey)
        .AddClaim("example", "Hello Paseto!")
        .Expiration(DateTime.UtcNow.AddHours(24))
        .AsPublic() // Purpose
        .Build();

You can check the README as what it was back then here.

Will take a look if is possible to support 4.8.

beastlyDartfordian commented 1 year ago

Hi David,

Thanks for the response, I've managed to get it working successfully so thanks for that as well.

If you could take a look at the possibility of supporting 4.8 that would be great. We've only just upgraded to it, and don't see us moving to core any time soon