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); }
protected void GenerateUserToken() { var token = JwtUtility.Encode(user.Id, UnixDateUtility.ConvertToUnixTimestamp(user.GetExpiration()), UnixDateUtility.ConvertToUnixTimestamp(user.LastLogon)); user.SetToken(token); }