RLMAPIKeyAuth
Objective-C
@interface RLMAPIKeyAuth : RLMProviderClient
Swift
class RLMAPIKeyAuth : RLMProviderClient
Provider client for user API keys.
-
Creates a user API key that can be used to authenticate as the current user.
Declaration
Objective-C
- (void)createAPIKeyWithName:(nonnull NSString *)name completion:(nonnull RLMOptionalUserAPIKeyBlock)completion;
Swift
func createAPIKey(named name: String, completion: @escaping RLMOptionalUserAPIKeyBlock)
Parameters
name
The name of the API key to be created.
completion
A callback to be invoked once the call is complete.
-
Fetches a user API key associated with the current user.
Declaration
Objective-C
- (void)fetchAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMOptionalUserAPIKeyBlock)completion;
Swift
func fetchAPIKey(_ objectId: RLMObjectId, completion: @escaping RLMOptionalUserAPIKeyBlock)
Parameters
objectId
The ObjectId of the API key to fetch.
completion
A callback to be invoked once the call is complete.
-
Fetches the user API keys associated with the current user.
Declaration
Objective-C
- (void)fetchAPIKeysWithCompletion:(nonnull RLMUserAPIKeysBlock)completion;
Swift
func fetchAPIKeys(completion: @escaping RLMUserAPIKeysBlock)
Parameters
completion
A callback to be invoked once the call is complete.
-
Deletes a user API key associated with the current user.
Declaration
Objective-C
- (void)deleteAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMAPIKeyAuthOptionalErrorBlock)completion;
Swift
func deleteAPIKey(_ objectId: RLMObjectId, completion: @escaping RLMAPIKeyAuthOptionalErrorBlock)
Parameters
objectId
The ObjectId of the API key to delete.
completion
A callback to be invoked once the call is complete.
-
Enables a user API key associated with the current user.
Declaration
Objective-C
- (void)enableAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMAPIKeyAuthOptionalErrorBlock)completion;
Swift
func enableAPIKey(_ objectId: RLMObjectId, completion: @escaping RLMAPIKeyAuthOptionalErrorBlock)
Parameters
objectId
The ObjectId of the API key to enable.
completion
A callback to be invoked once the call is complete.
-
Disables a user API key associated with the current user.
Declaration
Objective-C
- (void)disableAPIKey:(nonnull RLMObjectId *)objectId completion:(nonnull RLMAPIKeyAuthOptionalErrorBlock)completion;
Swift
func disableAPIKey(_ objectId: RLMObjectId, completion: @escaping RLMAPIKeyAuthOptionalErrorBlock)
Parameters
objectId
The ObjectId of the API key to disable.
completion
A callback to be invoked once the call is complete.