mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-06 13:00:55 +00:00
sadasd
This commit is contained in:
1 parent
3c006b8c6d
commit
86e759bde7
25 files changed
+339
-360
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using Novell.Directory.Ldap;
|
||||
|
||||
namespace CartriX.Server.Controllers
|
||||
{
|
||||
public class CheckDomain
|
||||
{
|
||||
public bool Authenticate(string username, string password)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var conn = new LdapConnection())
|
||||
{
|
||||
conn.Connect("your-domain.local", 389);
|
||||
conn.Bind($"{username}@your-domain.local", password);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user