private string GetClientSpecifiedSpn()
        {
            if (!(IsValidContext && IsCompleted))
            {
                NetEventSource.Fail(this, "Trying to get the client SPN before handshaking is done!");
            }

            string spn = NegotiateStreamPal.QueryContextClientSpecifiedSpn(_securityContext);

            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Info(this, $"The client specified SPN is [{spn}]");
            }

            return(spn);
        }
Ejemplo n.º 2
0
        private string GetClientSpecifiedSpn()
        {
            if (!(IsValidContext && IsCompleted))
            {
                if (GlobalLog.IsEnabled)
                {
                    GlobalLog.Assert("NTAuthentication: Trying to get the client SPN before handshaking is done!");
                }

                Debug.Fail("NTAuthentication: Trying to get the client SPN before handshaking is done!");
            }

            string spn = NegotiateStreamPal.QueryContextClientSpecifiedSpn(_securityContext);

            if (GlobalLog.IsEnabled)
            {
                GlobalLog.Print("NTAuthentication: The client specified SPN is [" + spn + "]");
            }
            return(spn);
        }