An Objective-C iOS framework that simplifies interfacing with APIs secured by HMAC signatures for authenticated requests.
Objective-C iOS framework for interfacing with APIs that implement hmac signatures
This tool is designed for iOS developers who need to securely authenticate API requests using HMAC signatures, particularly when working with JSON APIs implementing simple-hmac-auth. It streamlines the process of signing requests and managing authentication credentials within iOS applications.
This framework assumes the backend API implements the simple-hmac-auth specification; ensure your API supports this for compatibility. Proper management of API keys and secrets is critical to maintain security. The framework supports both Swift and Objective-C usage patterns, making it flexible for different iOS projects.
Include the SimpleHMACAuth framework in your Xcode project
Import the header with #include <SimpleHMACAuth/SimpleAuthClient.h>
Initialize SimpleAuthClient with your API key and secret
let client = SimpleAuthClient(apiKey: "API_KEY", secret: "SECRET")
Initializes the SimpleAuthClient instance with API credentials in Swift.
client.settings.setValue("localhost", forKey: "host")
Sets the API host address in the client settings.
client.call("GET", path: "/items/", query: nil, body: nil) { (response, error) in ... }
Makes an authenticated GET request to the specified API path asynchronously in Swift.
SimpleAuthClient *client = [[SimpleAuthClient alloc] initWithAPIKey:@"API_KEY" secret:@"SECRET"]
Initializes the SimpleAuthClient instance with API credentials in Objective-C.
[client.settings setValue:@"localhost" forKey:@"host"]
Sets the API host address in the client settings in Objective-C.
[client call:@"GET" path:@"/items/" query:nil body:nil completion:^(id _Nullable response, NSError * _Nullable error) { ... }]
Makes an authenticated GET request to the specified API path asynchronously in Objective-C.