- Store the username
un
, first namefn
, last nameln
, user rolesrs
, user departmentdt
, time when user profile was encrypted in UtcTicksut
(number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001), and expiry timete
in minutes in a JSON string:
{
"un":"John.Citizen",
"fn":"John",
"ln":"Citizen",
"rs":["Administrator","AlertAdmin","ClientAdmin"],
"dt":"HumanResources,IT",
"ut":637277353891062353,
"te": 30
}
2. Encrypt the JSON string using the AES cryptoalgorithm with a 128-bit key (https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.aescryptoserviceprovider).
3. Use Base64 encoding to encode the array of encrypted bytes.