internal static BindMethod ToBindMethod(LdapAuthType authType)
            {
                switch (authType)
                {
                case LdapAuthType.Simple:
                    return(BindMethod.LDAP_AUTH_SIMPLE);

                case LdapAuthType.Anonymous:
                    return(BindMethod.LDAP_AUTH_SIMPLE);

                case LdapAuthType.Negotiate:
                    return(BindMethod.LDAP_AUTH_NEGOTIATE);

                case LdapAuthType.GssApi:
                    return(BindMethod.LDAP_AUTH_NEGOTIATE);

                case LdapAuthType.Digest:
                    return(BindMethod.LDAP_AUTH_NEGOTIATE);

                case LdapAuthType.External:
                case LdapAuthType.ExternalAd:
                    return(BindMethod.LDAP_AUTH_EXTERNAL);

                case LdapAuthType.Unknown:
                    return(BindMethod.LDAP_AUTH_OTHERKIND);

                default:
                    throw new ArgumentOutOfRangeException(nameof(authType), authType, null);
                }
            }
            internal static string FromAuthType(LdapAuthType authType)
            {
                switch (authType)
                {
                case LdapAuthType.Simple:
                    return(SIMPLE);

                case LdapAuthType.Negotiate:
                    return(Kerberos);

                case LdapAuthType.GssApi:
                    return(GSSAPI);

                case LdapAuthType.Digest:
                    return(Digest);

                case LdapAuthType.External:
                case LdapAuthType.ExternalAd:
                    return(External);

                case LdapAuthType.Anonymous:
                    return(Anonymous);

                case LdapAuthType.Unknown:
                    return(string.Empty);

                default:
                    throw new ArgumentOutOfRangeException(nameof(authType), authType, null);
                }
            }
Ejemplo n.º 3
0
 internal abstract int BindSasl(SafeHandle ld, LdapAuthType authType, LdapCredential ldapCredential);
Ejemplo n.º 4
0
 internal abstract Task <IntPtr> BindSaslAsync(SafeHandle ld, LdapAuthType authType,
                                               LdapCredential ldapCredential, LDAP_TIMEVAL timeout);
Ejemplo n.º 5
0
 internal abstract Task <IntPtr> BindSaslAsync(SafeHandle ld, LdapAuthType authType,
                                               LdapCredential ldapCredential);