1
0
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:
Kyle Spearrin
2017-05-15 11:08:06 -04:00
parent 6ede5550b8
commit db1ead6754
12 changed files with 342 additions and 85 deletions

View 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;
}
}
}