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

ValidateCreateContext() private method

private ValidateCreateContext ( string package, NetworkCredential credential, string servicePrincipalName, ExtendedProtectionPolicy policy, ProtectionLevel protectionLevel, TokenImpersonationLevel impersonationLevel ) : void
package string
credential NetworkCredential
servicePrincipalName string
policy ExtendedProtectionPolicy
protectionLevel ProtectionLevel
impersonationLevel TokenImpersonationLevel
return void
        internal void ValidateCreateContext(
            string package,
            NetworkCredential credential,
            string servicePrincipalName,
            ExtendedProtectionPolicy policy,
            ProtectionLevel protectionLevel,
            TokenImpersonationLevel impersonationLevel)
        {
            if (policy != null)
            {
                // One of these must be set if EP is turned on
                if (policy.CustomChannelBinding == null && policy.CustomServiceNames == null)
                {
                    throw new ArgumentException(SR.net_auth_must_specify_extended_protection_scheme, nameof(policy));
                }

                _extendedProtectionPolicy = policy;
            }
            else
            {
                _extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never);
            }

            ValidateCreateContext(package, true, credential, servicePrincipalName, _extendedProtectionPolicy.CustomChannelBinding, protectionLevel, impersonationLevel);
        }

Same methods

NegoState::ValidateCreateContext ( string package, bool isServer, NetworkCredential credential, string servicePrincipalName, ChannelBinding channelBinding, ProtectionLevel protectionLevel, TokenImpersonationLevel impersonationLevel ) : void

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::ValidateCreateContext