Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

laiso/CocoaWSSE

Repository files navigation

CocoaWSSE

Build Status

A WSSE authentication header for Cocoa.

NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://..."]];
[req setValue:[CocoaWSSE headerWithUsername:@"sample" password:@"passwd"] forHTTPHeaderField:@"X-WSSE"];

[NSURLConnection sendAsynchronousRequest:req queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *res, NSData *data, NSError *err) {
    ...
}];
(lldb) po [req allHTTPHeaderFields]
...
    "X-WSSE" = "UsernameToken Username=\"sample\", PasswordDigest=\"4KgZgUd7Nl2XZUHKOuS/EKPUL04=\", Nonce=\"QjIwOUZEQzQ4RjQ2NUEyRkRCMTgwQkM5RjlFNzM2N0UwNkUwNDlENw==\", Created=\"2013-09-19T19:15:04+0900\"";

Install

pod 'CocoaWSSE'