コード例 #1
0
        public bool GetSessionToken(DomainUser user)
        {
            log.WriteLogEntry("Starting GetSessionToken...");
            bool result = false;

            log.WriteLogEntry("Starting TokenHandler...");
            TokenHandler tokenHandle = new TokenHandler();

            if (tokenHandle.GenerateDomainToken(user))
            {
                user.Token.UserID = user.UserID;
                result            = true;
                log.WriteLogEntry(string.Format("Current user {0} {1} {2} {3} {4}", user.UserID, user.UserName, user.DomainUpn, user.Token.SessionKey, user.Authenicated));
            }
            else
            {
                log.WriteLogEntry("FAILED to generate domain session key!");
            }
            log.WriteLogEntry("End GetSessionToken.");
            return(result);
        }