Class User.ApiKeyClient
A class exposing functionality for users to manage API keys from the client. It is always scoped
to a particular User and can only be accessed via Api
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public class User.ApiKeyClient
Methods
| Edit this page View SourceCreateAsync(string)
Creates an API key that can be used to authenticate as the user.
Declaration
public Task<ApiKey> CreateAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The friendly name of the key. |
Returns
Type | Description |
---|---|
Task<Api |
An awaitable Task<TResult> representing the asynchronous operation. Successful completion indicates
that the Api |
Remarks
The value of the returned API key must be persisted at this time as this is the only
time it is visible. The key is enabled when created. It can be disabled by calling
Disable
DeleteAsync(ObjectId)
Deletes an API key by id.
Declaration
public Task DeleteAsync(ObjectId id)
Parameters
Type | Name | Description |
---|---|---|
Object |
id | The id of the key to delete. |
Returns
| Edit this page View SourceDisableAsync(ObjectId)
Disables an API key by id.
Declaration
public Task DisableAsync(ObjectId id)
Parameters
Type | Name | Description |
---|---|---|
Object |
id | The id of the key to disable. |
Returns
See Also
| Edit this page View SourceEnableAsync(ObjectId)
Enables an API key by id.
Declaration
public Task EnableAsync(ObjectId id)
Parameters
Type | Name | Description |
---|---|---|
Object |
id | The id of the key to enable. |
Returns
See Also
| Edit this page View SourceFetchAllAsync()
Fetches all API keys associated with the user.
Declaration
public Task<IEnumerable<ApiKey>> FetchAllAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Api |
An awaitable task representing the asynchronous lookup operation. Upon completion, the result contains a collection of all API keys for that user. |
FetchAsync(ObjectId)
Fetches a specific user API key by id.
Declaration
public Task<ApiKey?> FetchAsync(ObjectId id)
Parameters
Type | Name | Description |
---|---|---|
Object |
id | The id of the key to fetch. |
Returns
Type | Description |
---|---|
Task<Api |
An awaitable Task<TResult> representing the asynchronous lookup operation. |