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 basic authentication, theapplication registers a listener with OData SDK. If the ODPHTTPAuthChallengeListenerDelegate is not registered, an HTTP response code 401 is returned when a challenge is received.

See Configuring SAP Mobile Server to use Relay Server in SAP Control Center for SAP Mobile Platform for information on the configuration of relay server properties.

Syntax

To register a listener for certificate verification, implement the protocol ODPHTTPAuthChallengeListenerDelegate

@protocol ODPHTTPAuthChallengeListenerDelegate <NSObject>   
@required
-(void) onHTTPAuthChallenge:(NSString*)host forUser:(NSString*)userName withRealm:(NSString*)realm;   
@end

Examples