C# Класс pGina.Plugin.Ldap.LdapServer

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Authenticate ( string uname, string password ) : BooleanResult

Attempt to authenticate the user by binding to the LDAP server.

Bind ( ) : void

Tries to bind to the server anonymously. Throws LdapException if the bind fails.

Bind ( NetworkCredential creds ) : void

Try to bind to the LDAP server with the given credentials. This uses basic authentication. Throws LdapException if the bind fails.

BindForSearch ( ) : void
Close ( ) : void
Dispose ( ) : void
FindFirstDN ( string searchBase, string filter ) : string

Does a search in the subtree at searchBase, using the filter provided and returns the DN of the first match.

GetUserDN ( string uname ) : string
LdapServer ( ) : System
MemberOfGroup ( string user, string group ) : bool
SetUserAttribute ( string uname, string attribute, string value ) : void

Приватные методы

Метод Описание
Connect ( ) : void
CreateSearchFilter ( string uname ) : string

This generates the search filter to be used when searching for the DN

CreateUserDN ( string uname ) : string

This generates the DN for the user assuming that a pattern has been provided. This assumes that Settings.Store.DnPattern has a valid DN pattern.

FindUserDN ( string uname ) : string

Attempts to find the DN for the user by searching a set of LDAP trees. The base DN for each of the trees is retrieved from Settings.Store.SearchContexts. The search filter is taken from Settings.Store.SearchFilter. If all searches fail, this method returns null.

VerifyCert ( System.DirectoryServices.Protocols.LdapConnection conn, X509Certificate cert ) : bool

This is the verify certificate callback method used when initially binding to the LDAP server. This manages all certificate validation.

Описание методов

Authenticate() публичный Метод

Attempt to authenticate the user by binding to the LDAP server.
public Authenticate ( string uname, string password ) : BooleanResult
uname string
password string
Результат pGina.Shared.Types.BooleanResult

Bind() публичный Метод

Tries to bind to the server anonymously. Throws LdapException if the bind fails.
public Bind ( ) : void
Результат void

Bind() публичный Метод

Try to bind to the LDAP server with the given credentials. This uses basic authentication. Throws LdapException if the bind fails.
public Bind ( NetworkCredential creds ) : void
creds System.Net.NetworkCredential The credentials to use when binding.
Результат void

BindForSearch() публичный Метод

public BindForSearch ( ) : void
Результат void

Close() публичный Метод

public Close ( ) : void
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

FindFirstDN() публичный Метод

Does a search in the subtree at searchBase, using the filter provided and returns the DN of the first match.
public FindFirstDN ( string searchBase, string filter ) : string
searchBase string The DN of the root of the subtree for the search (search context).
filter string The search filter.
Результат string

GetUserDN() публичный Метод

public GetUserDN ( string uname ) : string
uname string
Результат string

LdapServer() публичный Метод

public LdapServer ( ) : System
Результат System

MemberOfGroup() публичный Метод

public MemberOfGroup ( string user, string group ) : bool
user string
group string
Результат bool

SetUserAttribute() публичный Метод

public SetUserAttribute ( string uname, string attribute, string value ) : void
uname string
attribute string
value string
Результат void