private WebRioJsonWebTokenPayload GetWebRioSsoTokenPayload(WebRioSsoConfig configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            var payload = new WebRioJsonWebTokenPayload
            {
                IssuedAtTime = _jtiService.GetIssuedAtTime().ToString(),
                NotBefore    = _jtiService.GetNotBeforeTime(configuration.NotBeforeTime).ToString(),
                Expiry       = _jtiService.GetExpiry(configuration.ExpirySeconds).ToString(),
                Jti          = WebServiceExchangeHelper.GetJti().ToString(),
                BranchCode   = configuration.Login.BranchCode,
                AbtaNumber   = configuration.Login.AbtaNumber,
                EmployeeId   = configuration.Login.EmployeeId,
                Initials     = configuration.Login.Initials,
                Aud          = EntityRecords.Configuration.WebRioAudWebRio
            };

            if (configuration.RequestType == RequestType.TravelPlanner)
            {
                payload.TravelPlannerInitials = configuration.Initials;
                payload.IncludeInitials       = true;
            }
            else
            {
                payload.IncludeInitials = false;
            }

            return(payload);
        }
 public void Setup()
 {
     _jtiService = new JwtService(new Logger());
     _payload    = new OwrJsonWebTokenPayload
     {
         IssuedAtTime = _jtiService.GetIssuedAtTime().ToString(),
         NotBefore    = _jtiService.GetNotBeforeTime("100").ToString(),
         Expiry       = _jtiService.GetExpiry("100").ToString(),
         Jti          = WebServiceExchangeHelper.GetJti().ToString(),
         Aud          = "CRM",
         BranchCode   = "001",
         AbtaNumber   = "002",
         EmployeeId   = "1010",
         Initials     = "IMS",
         CreatedBy    = "IMS"
     };
 }
Example #3
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 #4
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);
        }
        private OwrJsonWebTokenPayload GetPayload(Entity login, string expiredSeconds, string notBeforeSeconds, string createdByInitials)
        {
            var payload = new OwrJsonWebTokenPayload
            {
                IssuedAtTime = _jtiService.GetIssuedAtTime().ToString(),
                NotBefore    = _jtiService.GetNotBeforeTime(notBeforeSeconds).ToString(),
                Expiry       = _jtiService.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    = createdByInitials,
                Aud          = EntityRecords.Configuration.OwrAudOneWebRetail
            };

            return(payload);
        }