public void SetIdsContext(string returnUrl, string clientId)
        {
            var value = new IdsContext()
            {
                ReturnUrl = returnUrl, ClientId = clientId
            };
            var cookieOptions = new CookieOptions()
            {
                Secure = true, HttpOnly = true
            };

            var encCookie = Convert.ToBase64String(MachineKey.Protect(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value))));

            _owinContext.Response.Cookies.Append(IdsContext.CookieName, encCookie, cookieOptions);;
        }
        public string GetIdsClientId()
        {
            var cookie = IdsContext.ReadFrom(_owinContext.Request.Cookies[IdsContext.CookieName]);

            return(cookie.ClientId);
        }
        public string GetIdsReturnUrl()
        {
            var cookie = IdsContext.ReadFrom(_owinContext.Request.Cookies[IdsContext.CookieName]);

            return(cookie.ReturnUrl);
        }