Enabling a Listener for HTTP(s) Support with Basic Auth Challenge

When a client attempts to connect to a host (like a relay server), this connection is authenticated with a basic authentication challenge. To setup a HTTP basic authentication, the application registers a delegate with the OData SDK. If the ODPHTTPAuthChallengeListenerDelegate is not registered, an HTTP_AUTH_FAILURE error is returned when a challenge is received.

Syntax

To register a listener for basic authentication, implement the protocol ODPHTTPAuthChallengeListenerDelegate

@protocol ODPHTTPAuthChallengeListenerDelegate <NSObject>
@required
-(void) onHTTPAuthChallenge:(NSString*)host forUser:(NSString*)userName withRealm:(NSString*)realm;
@end 
To forward the challenge result from the application to ODP, use the following API:
+ (void) httpAuthChallengeResult: (BOOL) credentialsSupplied forUser: (NSString*) userName withPassword: (NSString*) password

Parameters

Examples