-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathToken.pas
44 lines (36 loc) · 1.04 KB
/
Token.pas
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
unit Token;
interface
uses Generics.Collections, Rest.Json;
type
TToken = class
private
FAuthorities: TArray<string>;
FClient_Id: string;
FExp: Integer;
FJti: string;
FNome: string;
FScope: TArray<string>;
FUser_Name: string;
public
function ToJsonString: string;
class function FromJsonString(const AValue: string): TToken;
published
property Authorities: TArray<string> read FAuthorities write FAuthorities;
property Client_Id: string read FClient_Id write FClient_Id;
property Exp: Integer read FExp write FExp;
property Jti: string read FJti write FJti;
property Nome: string read FNome write FNome;
property Scope: TArray<string> read FScope write FScope;
property User_Name: string read FUser_Name write FUser_Name;
end;
implementation
{ TToken }
class function TToken.FromJsonString(const AValue: string): TToken;
begin
result := TJson.JsonToObject<TToken>(AValue);
end;
function TToken.ToJsonString: string;
begin
Result := TJson.ObjectToJsonString(self);
end;
end.