ClaimsCookie 0.9.0

.NET Framework 4.0
There is a newer version of this package available.
See the version list below for details.
Install-Package ClaimsCookie -Version 0.9.0
dotnet add package ClaimsCookie --version 0.9.0
<PackageReference Include="ClaimsCookie" Version="0.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ClaimsCookie --version 0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ClaimsCookie, 0.9.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ClaimsCookie as a Cake Addin
#addin nuget:?package=ClaimsCookie&version=0.9.0

// Install ClaimsCookie as a Cake Tool
#tool nuget:?package=ClaimsCookie&version=0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

An HttpModule that will serialize user information to a chunked protected cookie (with MachineKey) and deserialize on every request to a ClaimsPrincipal.

Usage:

var user = new Dictionary<string, string>
           {
               { "name", "John Foo" },
               { "id", "1234" },
               { "email", "foo@gmail.com" }
           };

ClaimsCookieModule.Instance.CreateSessionSecurityToken(user);

That's it. Now, you will be able to access the user claims like this:

((IClaimsIdentity)User.Identity).Claims

The cookie will be chunked in multiple cookies to avoid hitting a limit if you are storing lots of user info and it will be deflated and protected with the machine key.

Product Versions
.NET Framework net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 8,447 7/23/2013
1.0.0 1,286 7/1/2013
0.9.6 1,344 5/7/2013
0.9.5 1,000 5/7/2013
0.9.4 985 5/7/2013
0.9.3 1,045 3/21/2013
0.9.2 1,286 3/20/2013
0.9.1 1,071 3/20/2013
0.9.0 980 3/20/2013