コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PassportManager.CheckAuthenticated();

            bool    fromCookie = false;
            ITicket ticket     = PassportManager.GetTicket(out fromCookie);

            ShowTicketInfo(ticket);
        }
コード例 #2
0
        private static ITicket CheckAuthenticatedAndGetTicket(bool autoRedirect)
        {
            AuthenticateDirElement aDir =
                AuthenticateDirSettings.GetConfig().AuthenticateDirs.GetMatchedElement <AuthenticateDirElement>();

            bool needRedirect = autoRedirect && (aDir == null || aDir.AutoRedirect);

            PassportManager.CheckAuthenticated(needRedirect);

            TicketSource ticketSource = TicketSource.Unknown;

            return(PassportManager.GetTicket(out ticketSource));
        }