Info
Version: | 1.1.0 |
Author(s): | Auth0 |
Last Update: | Tuesday, July 23, 2013 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/auth0/ClaimsCookie |
NuGet Url: | https://www.nuget.org/packages/ClaimsCookie |
Install
Install-Package ClaimsCookie
dotnet add package ClaimsCookie
paket add ClaimsCookie
ClaimsCookie Download (Unzip the "nupkg" after downloading)
Dependencies
.NETFramework 4.0
- Microsoft.IdentityModel(6.1.7600.16394)
- WebActivatorEx(2.0.1)
- WebActivatorEx(2.0.1)
Tags
Usage:
var user = new List<KeyValuePair<string, object>>
{
new KeyValuePair<string, object>("name", "John Foo"),
new KeyValuePair<string, object>("id", "1234"),
new KeyValuePair<string, object>("email", "[email protected]")
};
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.