TUserClaim Class
Represents a single named claim about a user, holding a value that can be read and written as several primitive types.
Remarks
The underlying value is stored as a JSON element. The typed accessors (AsString, AsInteger, AsBoolean, and so on) convert to and from that representation, while the IsXxx properties report the value's actual JSON type. Reading a value as an incompatible type raises an exception.
Syntax
Unit: Sparkle.Security
TUserClaim = class(TObject);
Constructors
| Name | Description |
|---|---|
| Create | Overloaded Create(string) Create(string, TJElement) |
Methods
| Name | Description |
|---|---|
| SetJElement | Sets the claim value from the given JSON element, taking ownership of it. |
Properties
| Name | Description |
|---|---|
| AsBoolean | Gets or sets the claim value as a boolean. |
| AsDouble | Gets or sets the claim value as a floating-point number. |
| AsEpoch | Gets or sets the claim value as a date/time, stored as a Unix epoch (seconds). |
| AsInt64 | Gets or sets the claim value as a 64-bit integer. |
| AsInteger | Gets or sets the claim value as a 32-bit integer. |
| AsJson | Gets the claim value as its underlying JSON element. |
| AsString | Gets or sets the claim value as a string. |
| IsBoolean | Indicates whether the claim value is a JSON boolean. |
| IsDouble | Indicates whether the claim value is a JSON floating-point number. |
| IsInt64 | Indicates whether the claim value is a JSON integer that fits in a 64-bit integer. |
| IsInteger | Indicates whether the claim value is a JSON integer that fits in a 32-bit integer. |
| IsNull | Indicates whether the claim value is JSON null. |
| IsString | Indicates whether the claim value is a JSON string. |
| Name | Gets the claim name. |