简体   繁体   English

在PrincipalContext的ContextOption中,AuthenticationTypes.Secure的等价物是什么?

[英]What equivalent of AuthenticationTypes.Secure in PrincipalContext's ContextOption?

As titled, I am trying to converting DirectoryEntry parameter into PrincipalContext, but I don't see a ContextOption that equivalent to AuthenticationTypes.Secure in DirectionEntry. 标题为,我试图将DirectoryEntry参数转换为PrincipalContext,但我没有看到ContextEption等同于DirectionEntry中的AuthenticationTypes.Secure。

AuthenticationTypes.Secure: http://msdn.microsoft.com/en-us/library/system.directoryservices.authenticationtypes.aspx AuthenticationTypes.Secure: http://msdn.microsoft.com/en-us/library/system.directoryservices.authenticationtypes.aspx

Requests secure authentication. 请求安全身份验证。 When this flag is set, the WinNT provider uses NTLM to authenticate the client. 设置此标志后,WinNT提供程序使用NTLM对客户端进行身份验证。 Active Directory Domain Services uses Kerberos, and possibly NTLM, to authenticate the client. Active Directory域服务使用Kerberos(可能还有NTLM)来验证客户端。 When the user name and password are a null reference (Nothing in Visual Basic), ADSI binds to the object using the security context of the calling thread, which is either the security context of the user account under which the application is running or of the client user account that the calling thread is impersonating. 当用户名和密码是空引用(在Visual Basic中为Nothing)时,ADSI使用调用线程的安全上下文绑定到对象,调用线程的安全上下文是运行应用程序的用户帐户的安全上下文或调用线程模拟的客户端用户帐户。

ContextOption: http://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.contextoptions.aspx ContextOption: http//msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.contextoptions.aspx

I don't see anything similar.... 我没有看到类似的东西....

From my experience the ContextOptions.Negotiate is equivalent to AuthenticationTypes.Secure . 根据我的经验, ContextOptions.Negotiate等同于AuthenticationTypes.Secure See also the description on MSDN for both values. 另请参阅MSDN上两个值的说明。

ContextOptions.Negotiate - The client is authenticated by using either Kerberos or NTLM. ContextOptions.Negotiate - 使用Kerberos或NTLM对客户端进行身份验证。 When the user name and password are not provided, the Account Management API binds to the object by using the security context of the calling thread, which is either the security context of the user account under which the application is running or of the client user account that the calling thread represents. 如果未提供用户名和密码,则Account Management API将使用调用线程的安全上下文绑定到对象,该安全上下文是运行应用程序的用户帐户的安全上下文或客户端用户帐户的安全上下文调用线程代表的。

AuthenticationTypes.Secure - Requests secure authentication. AuthenticationTypes.Secure - 请求安全身份验证。 When this flag is set, the WinNT provider uses NTLM to authenticate the client. 设置此标志后,WinNT提供程序使用NTLM对客户端进行身份验证。 Active Directory Domain Services uses Kerberos, and possibly NTLM, to authenticate the client. Active Directory域服务使用Kerberos(可能还有NTLM)来验证客户端。

You can test this by using the following code: 您可以使用以下代码对此进行测试:

PrincipalContext ctx = new PrincipalContext(ContextType.Domain,
                                     "test.int",
                                     "CN=Users,DC=test,DC=int",
                                     ContextOptions.Negotiate,
                                     "administrator",
                                     "SecurePassword");

UserPrincipal usr = new UserPrincipal(ctx);

usr.Name = "Jim Daly";
usr.SamAccountName = "Jim.Daly";
usr.UserPrincipalName = "Jim.Daly@test.int";
usr.Description = "This is the user account for Jim Daly";
usr.EmailAddress = "jimdaly@test.int";
usr.SetPassword("VerySecurePwd");
usr.Save();

// Get the underlying directory entry.
DirectoryEntry de = (DirectoryEntry)usr.GetUnderlyingObject();

// Print the authentication type 
Console.Out.WriteLine(de.AuthenticationType);

I think the other options map as follows: 我认为其他选项映射如下:

ContextOptions.Sealing -> AuthenticationTypes.Sealing
ContextOptions.SecureSocketLayer -> AuthenticationTypes.Encryption
ContextOptions.ServerBind -> AuthenticationTypes.ServerBind
ContextOptions.Signing -> AuthenticationTypes.Signing
ContextOptions.SimpleBind -> AuthenticationTypes.None

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM