C#CAS .Net代理票在哪里?

时间:2016-08-11 16:39:54

标签: c# .net cas

使用:https://github.com/apereo/dotnet-cas-client

我们可以在生成的日志中成功查看代理服务单,但是在访问字段时会发现代理服务器代理服务器代理服务器#39;它总是空着的。

ICasPrincipal p = HttpContext.Current.User;
p.ProxyGrantingTicket

我们可以在缓存中看到故障单,但假设有一种方法可以访问它。

这有效,但想知道这是否是一个内置的功能。

    // Retrieves the cookie that contains your custom FormsAuthenticationTicket.
    var authCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];

    // Decrypts the FormsAuthenticationTicket that is held in the cookie's .Value property.
    var authTicket = FormsAuthentication.Decrypt(authCookie.Value);

    var ticket = HttpContext.Current.Cache["CasTicket::" + authTicket.UserData] as CasAuthenticationTicket;


    ticket.ProxyGrantingTicket

或稍微简化的方式......

var formTicket = CasAuthentication.GetFormsAuthenticationTicket();

var ticket = CasAuthentication.ServiceTicketManager.GetTicket(formTicket.UserData);

1 个答案:

答案 0 :(得分:0)

Is CasAuthentication.ProxyTicketManager.GetProxyGrantingTicket(string proxyGrantingTicketIou) not working?