Example #1
0
        private JsonWebTokenPayload GetPayload()
        {
            var payload = new JsonWebTokenPayload
            {
                IssuedAtTime = WebServiceExchangeHelper.GetIssuedAtTime().ToString(),
                NotBefore    = WebServiceExchangeHelper.GetNotBeforeTime("100").ToString(),
                Expiry       = WebServiceExchangeHelper.GetExpiry("100").ToString(),
                Jti          = WebServiceExchangeHelper.GetJti().ToString(),
                Aud          = "CRM",
                BranchCode   = "001",
                AbtaNumber   = "002",
                EmployeeId   = "1010",
                Initials     = "IMS",
                CreatedBy    = "IMS"
            };

            return(payload);
        }
Example #2
0
        private JsonWebTokenPayload GetPayload(Entity login, string expiredSeconds, string notBeforeSeconds)
        {
            var payload = new JsonWebTokenPayload
            {
                IssuedAtTime = WebServiceExchangeHelper.GetIssuedAtTime().ToString(),
                NotBefore    = WebServiceExchangeHelper.GetNotBeforeTime(notBeforeSeconds).ToString(),
                Expiry       = WebServiceExchangeHelper.GetExpiry(expiredSeconds).ToString(),
                Jti          = WebServiceExchangeHelper.GetJti().ToString(),
                BranchCode   = login.GetAttributeValue <string>("tc_branchcode"),
                AbtaNumber   = login.GetAttributeValue <string>("tc_abtanumber"),
                EmployeeId   = login.GetAttributeValue <string>("tc_employeeid"),
                Initials     = login.GetAttributeValue <string>("tc_initials"),
                CreatedBy    = login.GetAttributeValue <EntityReference>("createdby").Name,
                Aud          = DataKey.AudOneWebRetail
            };

            return(payload);
        }