I have a WCF data service hosted on a IIS server; I am using the Objective-C OData client implementation to query the WCF Data service.
I am now ready to deploy my service to a live server, and wish to provide an authentication mechanism, so that access to the service is restricted and also so I have an audit trail.
I have decided to use the ASP.NET Membership provider for this functionality. Users will register a username / password against a different (unprotected) service, which will enable them to access the restricted service.
I understand that I can use the ObjectConext::OnBeforeSend callback to setup the appropriate headers on the HTTP request, but I am unsure of how to do this. Would anyone have any examples?
EDIT
I do know how to add the headers to the request, this is not what I am asking. I am asking specifically, what headers do I actually add?
- (void) onBeforeSend: (HttpRequest*)request{
[request.m_httpHeaders.m_httpHeaders addEntriesFromDictionary:[NSDictionary
dictionaryWithObject:@"BlahBlahBlah" forKey:@"SomeHeader"]];
}
don’t know if it’s too late for you but here is the working way:
OR (depends on your iOS version i guess)