Exemple #1
0
        public static string GetToken(Token tokenObj)
        {
            try
            {
                string   token     = Guid.NewGuid().ToString();
                DateTime issuedOn  = DateTime.Now;
                DateTime expiredOn = DateTime.Now.AddSeconds(Convert.ToDouble(10));
                tokenObj.IssuedOn  = issuedOn;
                tokenObj.ExpiredOn = expiredOn;
                tokenObj.AuthToken = token;
                var ClientUrl = WebConfigurationManager.AppSettings["SubastaDescUrl"];


                if (DataUser.CreateToken(tokenObj))
                {
                    return(ClientUrl + tokenObj.AuthToken);
                }
                else
                {
                    return("");
                }
            }
            catch (Exception ex)
            {
                GasLogB.CrearLogError(ex);
                return("");
            }
        }