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.
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
[Preserve(AllMembers = true)]
public class ApiKey
Remarks
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.
Properties
| Improve this Doc View SourceId
Gets the unique identifier for this key.
Declaration
public ObjectId Id { get; }
Property Value
Type | Description |
---|---|
MongoDB.Bson.ObjectId | The id uniquely identifying the key. |
IsEnabled
Gets a value indicating whether or not this key is currently enabled.
Declaration
public bool IsEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
Name
Gets the name of the key.
Declaration
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
public string Value { get; }
Property Value
Type | Description |
---|---|
String | The value of the key that needs to be provided when constructing ApiKey(String). |
Methods
| Improve this Doc View SourceToString()
Returns a string representation of the value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representation of the value. |