System.Net.Security.NegoState.ProcessAuthentication C# (CSharp) Method

ProcessAuthentication() private method

private ProcessAuthentication ( LazyAsyncResult lazyResult ) : void
lazyResult LazyAsyncResult
return void
        internal void ProcessAuthentication(LazyAsyncResult lazyResult)
        {
            CheckThrow(false);
            if (Interlocked.Exchange(ref _nestedAuth, 1) == 1)
            {
                throw new InvalidOperationException(SR.Format(SR.net_io_invalidnestedcall, lazyResult == null ? "BeginAuthenticate" : "Authenticate", "authenticate"));
            }

            try
            {
                if (_context.IsServer)
                {
                    // Listen for a client blob.
                    StartReceiveBlob(lazyResult);
                }
                else
                {
                    // Start with the first blob.
                    StartSendBlob(null, lazyResult);
                }
            }
            catch (Exception e)
            {
                // Round-trip it through SetException().
                e = SetException(e);
                throw;
            }
            finally
            {
                if (lazyResult == null || _exception != null)
                {
                    _nestedAuth = 0;
                }
            }
        }

Usage Example

Example #1
0
        //
        public virtual void AuthenticateAsClient(NetworkCredential credential,
                                                 ChannelBinding binding,
                                                 string targetName,
                                                 ProtectionLevel requiredProtectionLevel,
                                                 TokenImpersonationLevel allowedImpersonationLevel)
        {
#if DEBUG
            using (GlobalLog.SetThreadKind(ThreadKinds.User | ThreadKinds.Sync)) {
#endif
            _NegoState.ValidateCreateContext(_Package, false, credential, targetName, binding, requiredProtectionLevel, allowedImpersonationLevel);
            _NegoState.ProcessAuthentication(null);
#if DEBUG
        }
#endif
        }
All Usage Examples Of System.Net.Security.NegoState::ProcessAuthentication