Beispiel #1
0
        public void TestJwtEncode()
        {
            var name = "mauricio";

            var dt1 = DateTime.Now;
            var dt2 = DateTime.Now.AddMinutes(30);

            var hash = JwtUtility.Encode(Guid.NewGuid(), UnixDateUtility.ConvertToUnixTimestamp(dt2), UnixDateUtility.ConvertToUnixTimestamp(dt1));

            var decode = JwtUtility.Decode(hash);
        }
Beispiel #2
0
        protected void GenerateUserToken()
        {
            var token = JwtUtility.Encode(user.Id, UnixDateUtility.ConvertToUnixTimestamp(user.GetExpiration()), UnixDateUtility.ConvertToUnixTimestamp(user.LastLogon));

            user.SetToken(token);
        }