Exemplo n.º 1
0
        public void DestroyTicket(String ticket, String username)
        {
            CASTicketResult t = CASTicketResult.GetToken(this.Database, Service, ticket, username);

            if (t.Success)
            {
                t.Destroy(this.Database);
            }
        }
Exemplo n.º 2
0
        public void DestroyTicket(String ticket, String username)
        {
            CASTicketResult t = CASTicketResult.GetToken(Path.Combine(BasePath.FullName, "tickets"), Service, ticket, username);

            if (t.Success)
            {
                t.Destroy(BasePath.FullName);
            }
        }
Exemplo n.º 3
0
        public CASTicketResult Grant(String username, String password)
        {
            //Checa se ha um ticket para este usuário
            CASTicketResult t = CASTicketResult.GetToken(this.Database, Service, null, username);

            if ((!t.Success) && (t.UserName != username))
            {
                t = null;
            }

            String   checkLog = "";
            LogEvent l        = new LogEvent(delegate(Object sender, PluginLogType type, String text)
            {
                if (type == PluginLogType.Error)
                {
                    checkLog += text + Environment.NewLine;
                }
            });

            this.Log += l;

            CASTicketResult ret = new CASTicketResult();

            try
            {
                if (!CheckInputConfig(this.Config, true, l))
                {
                    throw new Exception("Erro on check configurarion", new Exception(checkLog));
                }

                ret = iGrant(t, username, password);
            }
            catch { }

            this.Log -= l;

            //Se houver um ticket para este usuário utiliza os mesmos tokens
            if ((t != null) && (t.Success) && (t.UserName == ret.UserName))
            {
                ret.GrantTicket = t.GrantTicket;
                ret.LongTicket  = t.LongTicket;
                ret.ProxyTicket = t.ProxyTicket;
            }

            return(ret);
        }
Exemplo n.º 4
0
        //Valida através dos tokens existentes
        public CASTicketResult Grant(String ticket, Boolean renew, Boolean warm)
        {
            if (renew)
            {
                return(new CASTicketResult("Renew selected"));
            }

            CASTicketResult tgc = CASTicketResult.GetToken(this.Database, Service, ticket);

            if (warm && !tgc.CreateByCredentials)
            {
                return(new CASTicketResult());
            }
            else
            {
                return(tgc);
            }
        }
Exemplo n.º 5
0
        //Valida através dos tokens existentes
        public CASTicketResult Grant(String ticket, Boolean renew, Boolean warm)
        {
            if (renew)
            {
                return(new CASTicketResult("Renew selected"));
            }

            CASTicketResult tgc = CASTicketResult.GetToken(Path.Combine(BasePath.FullName, "tickets"), Service, ticket);

            if (warm && !tgc.CreateByCredentials)
            {
                return(new CASTicketResult());
            }
            else
            {
                return(tgc);
            }
        }