NegotiateStream.AuthenticateAsServer 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
处理客户端-服务器连接的身份验证的服务器端。
重载
| AuthenticateAsServer(NetworkCredential, ExtendedProtectionPolicy, ProtectionLevel, TokenImpersonationLevel) | 服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 身份验证过程使用指定的服务器凭据、身份验证选项和扩展保护策略。 | 
| AuthenticateAsServer(NetworkCredential, ProtectionLevel, TokenImpersonationLevel) | 服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 身份验证过程使用指定的服务器凭据和身份验证选项。 | 
| AuthenticateAsServer() | 服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 | 
| AuthenticateAsServer(ExtendedProtectionPolicy) | 服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 身份验证过程使用指定的扩展保护策略。 | 
注解
身份验证正在进行时,这些方法会阻止。 若要防止应用程序在等待身份验证完成时阻止,请使用 BeginAuthenticateAsServer 方法。
AuthenticateAsServer(NetworkCredential, ExtendedProtectionPolicy, ProtectionLevel, TokenImpersonationLevel)
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 身份验证过程使用指定的服务器凭据、身份验证选项和扩展保护策略。
public:
 virtual void AuthenticateAsServer(System::Net::NetworkCredential ^ credential, System::Security::Authentication::ExtendedProtection::ExtendedProtectionPolicy ^ policy, System::Net::Security::ProtectionLevel requiredProtectionLevel, System::Security::Principal::TokenImpersonationLevel requiredImpersonationLevel);public virtual void AuthenticateAsServer(System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy? policy, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel requiredImpersonationLevel);public virtual void AuthenticateAsServer(System.Net.NetworkCredential credential, System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy policy, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel requiredImpersonationLevel);abstract member AuthenticateAsServer : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel -> unit
override this.AuthenticateAsServer : System.Net.NetworkCredential * System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel -> unitPublic Overridable Sub AuthenticateAsServer (credential As NetworkCredential, policy As ExtendedProtectionPolicy, requiredProtectionLevel As ProtectionLevel, requiredImpersonationLevel As TokenImpersonationLevel)参数
- credential
- NetworkCredential
用于确立客户端身份的 NetworkCredential。
- policy
- ExtendedProtectionPolicy
用于扩展保护的 ExtendedProtectionPolicy。
- requiredProtectionLevel
- ProtectionLevel
ProtectionLevel 值之一,指示流的安全服务。
- requiredImpersonationLevel
- TokenImpersonationLevel
TokenImpersonationLevel 值之一,指示服务器使用客户端凭据访问资源的方式。
例外
在 policy 参数中传递的扩展保护策略上,CustomChannelBinding 和 CustomServiceNames 都是 null。
              credential 为 null。
              requiredImpersonationLevel 必须为 Identification、Impersonation 或 Delegation,
身份验证失败。 可以使用此对象尝试重新进行身份验证。
身份验证失败。 可以使用此对象尝试重新进行身份验证。
此对象已关闭。
在不支持扩展保护的平台上,policy 参数设置为 Always。
不支持 windows 95 和 Windows 98。
注解
              policy如果 参数为 null,则使用已设置为 Never的PolicyEnforcement扩展保护策略。
身份验证成功后,必须检查 IsEncrypted 和 IsSigned 属性来确定 所使用的NegotiateStream安全服务。 IsMutuallyAuthenticated检查 属性以确定是否发生了相互身份验证。
此方法将阻止,直到操作完成。 若要防止在操作完成之前阻止,请使用 方法重载之 BeginAuthenticateAsServer 一。
如果身份验证失败,则会收到 AuthenticationException 或 InvalidCredentialException。 在这种情况下,可以使用其他凭据重试身份验证。
另请参阅
适用于
AuthenticateAsServer(NetworkCredential, ProtectionLevel, TokenImpersonationLevel)
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 身份验证过程使用指定的服务器凭据和身份验证选项。
public:
 virtual void AuthenticateAsServer(System::Net::NetworkCredential ^ credential, System::Net::Security::ProtectionLevel requiredProtectionLevel, System::Security::Principal::TokenImpersonationLevel requiredImpersonationLevel);public virtual void AuthenticateAsServer(System.Net.NetworkCredential credential, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel requiredImpersonationLevel);abstract member AuthenticateAsServer : System.Net.NetworkCredential * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel -> unit
override this.AuthenticateAsServer : System.Net.NetworkCredential * System.Net.Security.ProtectionLevel * System.Security.Principal.TokenImpersonationLevel -> unitPublic Overridable Sub AuthenticateAsServer (credential As NetworkCredential, requiredProtectionLevel As ProtectionLevel, requiredImpersonationLevel As TokenImpersonationLevel)参数
- credential
- NetworkCredential
用于确立服务器身份的 NetworkCredential。
- requiredProtectionLevel
- ProtectionLevel
ProtectionLevel 值之一,指示流的安全服务。
- requiredImpersonationLevel
- TokenImpersonationLevel
TokenImpersonationLevel 值之一,指示服务器使用客户端凭据访问资源的方式。
例外
              credential 为 null。
              requiredImpersonationLevel 必须为 Identification、Impersonation 或 Delegation,
身份验证失败。 可以使用此对象尝试重新进行身份验证。
身份验证失败。 可以使用此对象尝试重新进行身份验证。
此对象已关闭。
不支持 windows 95 和 Windows 98。
注解
身份验证成功后,必须检查 IsEncrypted 和 IsSigned 属性来确定 所使用的NegotiateStream安全服务。 IsMutuallyAuthenticated检查 属性以确定是否发生了相互身份验证。
此方法将阻止,直到操作完成。 若要防止在操作完成之前阻止,请使用 方法重载之 BeginAuthenticateAsServer 一。
如果身份验证失败,则会收到 AuthenticationException 或 InvalidCredentialException。 在这种情况下,可以使用其他凭据重试身份验证。
适用于
AuthenticateAsServer()
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。
public:
 virtual void AuthenticateAsServer();public virtual void AuthenticateAsServer();abstract member AuthenticateAsServer : unit -> unit
override this.AuthenticateAsServer : unit -> unitPublic Overridable Sub AuthenticateAsServer ()例外
身份验证失败。 可以使用此对象尝试重新进行身份验证。
身份验证失败。 可以使用此对象尝试重新进行身份验证。
此对象已关闭。
不支持 windows 95 和 Windows 98。
注解
身份验证使用服务器的 DefaultCredentials。 未为服务器指定服务主体名称 (SPN) 。 模拟级别为 Identification,安全级别为 EncryptAndSign。
身份验证成功后,必须检查 IsEncrypted 和 IsSigned 属性来确定 所使用的NegotiateStream安全服务。 IsMutuallyAuthenticated检查 属性以确定是否发生了相互身份验证。
此方法将阻止,直到操作完成。 若要防止在操作完成之前阻止,请使用 方法重载之 BeginAuthenticateAsServer 一。
如果身份验证失败,则会收到 AuthenticationException 或 InvalidCredentialException。 在这种情况下,可以使用其他凭据重试身份验证。
适用于
AuthenticateAsServer(ExtendedProtectionPolicy)
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
- Source:
- NegotiateStream.cs
服务器调用此方法,以便对客户端-服务器连接中的客户端及服务器(可选)进行身份验证。 身份验证过程使用指定的扩展保护策略。
public:
 virtual void AuthenticateAsServer(System::Security::Authentication::ExtendedProtection::ExtendedProtectionPolicy ^ policy);public virtual void AuthenticateAsServer(System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy? policy);public virtual void AuthenticateAsServer(System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy policy);abstract member AuthenticateAsServer : System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy -> unit
override this.AuthenticateAsServer : System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy -> unitPublic Overridable Sub AuthenticateAsServer (policy As ExtendedProtectionPolicy)参数
- policy
- ExtendedProtectionPolicy
用于扩展保护的 ExtendedProtectionPolicy。
例外
在 policy 参数中传递的扩展保护策略上,CustomChannelBinding 和 CustomServiceNames 都是 null。
身份验证失败。 可以使用此对象尝试重新进行身份验证。
身份验证失败。 可以使用此对象尝试重新进行身份验证。
此对象已关闭。
在不支持扩展保护的平台上,policy 参数设置为 Always。
不支持 windows 95 和 Windows 98。
注解
身份验证使用服务器的 DefaultCredentials。 未为服务器指定服务主体名称 (SPN) 。 模拟级别为 Identification,安全级别为 EncryptAndSign。
              policy如果 参数为 null,则使用已设置为 Never的PolicyEnforcement扩展保护策略。
身份验证成功后,必须检查 IsEncrypted 和 IsSigned 属性来确定 所使用的NegotiateStream安全服务。 IsMutuallyAuthenticated检查 属性以确定是否发生了相互身份验证。
此方法将阻止,直到操作完成。 若要防止在操作完成之前阻止,请使用 方法重载之 BeginAuthenticateAsServer 一。
如果身份验证失败,则会收到 AuthenticationException 或 InvalidCredentialException。 在这种情况下,可以使用其他凭据重试身份验证。