Exemplo n.º 1
0
        public ActionResult VerifyTicket()
        {
            var ticket      = RequestUtils.GetString("Ticket");
            var callBackUrl = RequestUtils.GetString("CallBackUrl");
            //验证Ticket
            var verifyResult = _ticketManager.VerifyTicket(ticket);

            if (verifyResult)
            {
                //如果验证成功,那么将Account信息返回给客户端
                var account     = _ticketGrantingManager.GetTicketGranting();
                var key         = "";
                var accountBack = _ticketGrantingManager.BackAccount(account, out key);
                //根据CallBack地址 先拿到请求是属于哪一个客户端
                var webAppInfo = _webAppManager.GetWebAppInfoByUrl(callBackUrl);
                return(Redirect(UrlUtils.GetClientPutUrl(webAppInfo, accountBack, key, callBackUrl)));
            }
            return(Redirect(UrlUtils.GetVerifyUrl(callBackUrl)));
        }