Enabling a Listener for HTTPS Support with Basic Authentication 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, the application 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