Class ApiKey
A class representing an API key for a User. It can be used to represent the user when logging in
instead of their regular credentials. These keys are created or fetched through ApiKeys.
An API key's Value is only available when the key is created and cannot be obtained after that.
This means that it's the caller's responsibility to safely store an API key's value upon creation.
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public class ApiKey
Properties
| Edit this page View SourceId
Gets the unique identifier for this key.
Declaration
[Preserve]
public ObjectId Id { get; }
Property Value
Type | Description |
---|---|
ObjectId | The id uniquely identifying the key. |
IsEnabled
Gets a value indicating whether or not this key is currently enabled.
Declaration
[Preserve]
public bool IsEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
|
Name
Gets the name of the key.
Declaration
[Preserve]
public string Name { get; }
Property Value
Type | Description |
---|---|
string | The friendly name of the key, specified when calling CreateAsync(string). |
Value
Gets the value for the key. This is only returned when the key is created. After that, it will always be null
.
Declaration
[Preserve]
public string? Value { get; }
Property Value
Type | Description |
---|---|
string | The value of the key that needs to be provided when constructing ApiKey(string). |
Methods
| Edit this page View SourceToString()
Returns a string representation of the value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of the value. |