-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathIUserWithClaims.cs
More file actions
26 lines (24 loc) · 908 Bytes
/
IUserWithClaims.cs
File metadata and controls
26 lines (24 loc) · 908 Bytes
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
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Waher.Security.JWT
{
/// <summary>
/// A User that can participate in distributed operations, where the user is identified using a JWT token.
/// </summary>
public interface IUserWithClaims : IUser
{
/// <summary>
/// Creates a set of claims identifying the user.
/// </summary>
/// <param name="Encrypted">If communication is encrypted.</param>
/// <returns>Set of claims.</returns>
Task<IEnumerable<KeyValuePair<string, object>>> CreateClaims(bool Encrypted);
/// <summary>
/// Creates a JWT Token referencing the user object.
/// </summary>
/// <param name="Factory">JWT Factory.</param>
/// <param name="Encrypted">If communication is encrypted.</param>
/// <returns>Token, if able to create a token, null otherwise.</returns>
Task<string> CreateToken(JwtFactory Factory, bool Encrypted);
}
}