TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Nov 2016 |
Maintained by Martin Fernandez.
HMACSigner signs your requests using HMAC + SHA1. It was adesigned to work with ApiAuth gem.
Basically it does this
To use it:
Objective-C
NSURL *url = [NSURL URLWithString:@"https://api.domain.com/users/me"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
request.HTTPMethod = @"POST";
request.HTTPBody = [@"Message" dataUsingEncoding:NSUTF8StringEncoding];
[request setValue:@"application/text" forHTTPHeaderField:@"Content-Type"];
[request signWithAccessIdentifier:@"userId" andSecret:@"secret"];
Swift
let request = NSMutableURLRequest( url: URL(string: "https://api.domain.com/users/me"))
request.httpMethod = "POST"
request.httpBody = "Message".data(using: .utf8)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.sign(withAccessIdentifier: "userId", andSecret: "secret")
To run the example project, clone the repo, and run pod install
from the Example directory first.
Martin Fernandez [email protected]
HMACSigner is available under the MIT license. See the LICENSE file for more info.