mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-17 16:53:25 +00:00
azure directory service implementation w/ config
This commit is contained in:
28
src/Core/Models/LdapConfiguration.cs
Normal file
28
src/Core/Models/LdapConfiguration.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.DirectoryServices;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bit.Core.Models
|
||||
{
|
||||
public class LdapConfiguration
|
||||
{
|
||||
public string Address { get; set; }
|
||||
public string Port { get; set; } = "389";
|
||||
public string Path { get; set; }
|
||||
public string Username { get; set; }
|
||||
public EncryptedData Password { get; set; }
|
||||
[JsonIgnore]
|
||||
public string ServerPath => $"LDAP://{Address}:{Port}/{Path}";
|
||||
public Enums.DirectoryType Type { get; set; } = Enums.DirectoryType.ActiveDirectory;
|
||||
|
||||
public DirectoryEntry GetDirectoryEntry()
|
||||
{
|
||||
var entry = new DirectoryEntry(ServerPath, Username, Password.DecryptToString(), AuthenticationTypes.None);
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user