forked from UniStuttgart-VISUS/Visus.LdapAuthentication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathILdapUser.cs
65 lines (54 loc) · 2.22 KB
/
ILdapUser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// <copyright file="ILdapUser.cs" company="Visualisierungsinstitut der Universität Stuttgart">
// Copyright © 2021 - 2024 Visualisierungsinstitut der Universität Stuttgart.
// Licensed under the MIT licence. See LICENCE file for details.
// </copyright>
// <author>Christoph Müller</author>
using System.Collections.Generic;
using System.DirectoryServices.Protocols;
using System.Security.Claims;
using System.Text.Json.Serialization;
namespace Visus.DirectoryAuthentication {
/// <summary>
/// Interface for an application user object.
/// </summary>
public interface ILdapUser {
/// <summary>
/// Gets the unique account name of the user.
/// </summary>
string AccountName { get; }
/// <summary>
/// Gets the claims (eg group memberships) for the user.
/// </summary>
IEnumerable<Claim> Claims { get; }
/// <summary>
/// Gets the display name of the user.
/// </summary>
string DisplayName { get; }
/// <summary>
/// Gets the e-mail address of the user.
/// </summary>
string EmailAddress { get; }
/// <summary>
/// Gets the security identifier of the user.
/// </summary>
string Identity { get; }
/// <summary>
/// Gets the attributes that must be loaded for each
/// <see cref="System.DirectoryServices.Protocols.SearchResultEntry"/>
/// in order to fill all properties and claims of the user object.
/// </summary>
[JsonIgnore]
IEnumerable<string> RequiredAttributes { get; }
/// <summary>
/// Assigns the specified LDAP entry as the user.
/// </summary>
/// <param name="entry">The entry representing the user.</param>
/// <param name="connection">A <see cref="LdapConnection"/> that can be
/// used to obtain additional information about the user.</param>
/// <param name="options">The <see cref="LdapOptions"/> that can be used
/// to obtain additional information about the user-defined mapping of
/// LDAP attributes.</param>
void Assign(SearchResultEntry entry, LdapConnection connection,
ILdapOptions options);
}
}