https://github.com/jessety/simple-hmac-auth-objc
Objective-C iOS framework for interfacing with APIs that implement hmac signatures
https://github.com/jessety/simple-hmac-auth-objc
api-security hmac-authentication ios objective-c request-signatures request-signing simple-hmac-auth
Last synced: about 1 year ago
JSON representation
Objective-C iOS framework for interfacing with APIs that implement hmac signatures
- Host: GitHub
- URL: https://github.com/jessety/simple-hmac-auth-objc
- Owner: jessety
- License: mit
- Created: 2018-11-25T02:26:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-06T17:35:47.000Z (about 7 years ago)
- Last Synced: 2025-01-04T02:48:39.746Z (about 1 year ago)
- Topics: api-security, hmac-authentication, ios, objective-c, request-signatures, request-signing, simple-hmac-auth
- Language: Objective-C
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-hmac-auth-ios
iOS framework for interfacing with APIs that implement HMAC signatures. Designed for use with a JSON API that implements [simple-hmac-auth](https://github.com/jessety/simple-hmac-auth).
## Usage
### Swift
```swift
let client = SimpleAuthClient(apiKey: "API_KEY", secret: "SECRET")
client.settings.setValue("localhost", forKey: "host")
client.settings.setValue(8000, forKey: "port");
client.settings.setValue(false, forKey: "ssl");
client.settings.setValue(true, forKey: "verbose")
client.call("GET", path: "/items/", query: nil, body: nil) { (response, error) in
guard error == nil else {
print("Error:", error!)
return
}
print("Request succeeded")
print("\(response!)")
}
```
### Objective-C
```obj-c
#include
SimpleAuthClient *client = [[SimpleAuthClient alloc] initWithAPIKey:@"API_KEY" secret:@"SECRET"];
[client.settings setValue:@"localhost" forKey: @"host"];
[client.settings setValue:@8000 forKey: @"port"];
[client.settings setValue:@false forKey: @"ssl"];
[client.settings setValue:@true forKey: @"verbose"];
[client call:@"GET" path:@"/items/" query:nil body:nil completion:^(id _Nullable response, NSError * _Nullable error) {
if (error) {
NSLog(@"Error:", error);
return;
}
NSLog(@"Request Succeeded");
NSLog(@"%@", response);
}];
```