Ejemplo n.º 1
0
        public static async Task <string> RequestNewTokenAsync(string tumId)
        {
            TumOnlineRequest request = new TumOnlineRequest(TumOnlineService.REQUEST_TOKEN);

            request.AddQuery(ATTRIBUTE_TOKEN_NAME, GetTokenName());
            request.AddQuery(ATTRIBUTE_USER_NAME, tumId);
            XmlDocument doc = await request.RequestDocumentAsync();

            return(LoadToken(doc));
        }
Ejemplo n.º 2
0
        public static async Task <bool> IsTokenActivated(string token)
        {
            TumOnlineRequest request = new TumOnlineRequest(TumOnlineService.TOKEN_ACTIVATED);

            request.AddQuery(ATTRIBUTE_TOKEN, token);

            try
            {
                XmlDocument doc = await request.RequestDocumentAsync();

                XmlNode node = doc.SelectSingleNode("confirmed");
                return(!(node is null) && bool.Parse(node.InnerText));
            }
            catch (Exception e)
            {
                Logger.Error("Failed to check if token is activated!", e);
                return(false);
            }
        }