Manage access across the firewall via the URL Loading System. More...
#import <BlackBerryDynamics/GD/GDURLLoadingSystem.h>
BlackBerry Dynamics applications can utilize the native URL Loading System to communicate with servers that are behind the enterprise firewall. Communication across the enterprise firewall utilizes the BlackBerry Dynamics proxy infrastructure, which is secure.
Access across the firewall is enabled in the URL Loading System by default, when authorization of the application succeeds. The application can subsequently disable and enable access. If the application's or the user's authorization is withdrawn, access is implicitly disabled for the duration of the withdrawal.
Access across the firewall utilizes the BlackBerry Dynamics proxy infrastructure. The BlackBerry Dynamics SDK includes a class that interfaces with the infrastructure. The interfacing class is also compatible to be registered as a URL handler in the URL Loading System. Enabling and disabling access across the firewall actually registers and de-registers the interfacing class. This means that, when access is disabled, the default URL Loading System handlers will service any URL requests.
Note that synchronous request calls shouldn't be made from the main application thread.
Note the following details.
NSURLAuthenticationMethodHTTPBasic
is supported.NSURLAuthenticationMethodDefault
is treated as NSURLAuthenticationMethodHTTPBasic
.NSURLAuthenticationMethodHTTPDigest
is supported.NSURLAuthenticationMethodNTLM
is supported, specifically: NTLMv1, NTLMv2, and NTLM2 Session.NSURLAuthenticationMethodNegotiate
is supported for Kerberos version 5.@
realm, and a password.NSURLCredentialPersistence
flag of NSURLCredential
:NSURLCredentialPersistenceNone
credential is used for this connection onlyNSURLCredentialPersistenceForSession
credential is persisted in memoryNSURLCredentialPersistencePermanent
treated as NSURLCredentialPersistenceForSession
YES
is assumed for the setAllowsCellularAccess
flag. See the NSMutableURLRequest class reference on the apple.com developer website for details of this flag.
Additional features are made available, using the NSMutableURLRequest(GDNET) category, and the NSURLCache(GDURLCache) subclass.
An HTTP server may support multiple authentication methods. For example, a server could support both NTLM and Kerberos authentication. By default, the BlackBerry Dynamics runtime handles this by selecting the first authentication method presented.
The application can implement its own handling for multiple authentication methods, as follows.
le:GDRejectAuthSupport
Boolean
YES
connection::willSendRequestForAuthenticationChallenge
callback.rejectProtectionSpaceAndContinueWithChallenge
function, where necessary.The following code snippet illustrates a simple implementation of the callback mentioned in the above.
By default, HTTP cookies received through BlackBerry Dynamics secure communication are handled automatically:
The BlackBerry Dynamics cookie store persists between executions of the application, and if the mobile device is switched off. The contents of the store can be managed with the native NSHTTPCookieStorage
programming interface, and so can non-persistent cookies received through BlackBerry Dynamics secure communication.
Automatic handling of HTTP cookies received through BlackBerry Dynamics secure communication can be switched off, as follows.
GDURLLoad
ingSystem
, such as NSURLSession
and NSURLConnection
, call the setHTTPShouldHandleCookies:
method of the associated NSMutableURLRequest
instance.Class Methods | |
(void) | + enableSecureCommunication |
Enable access across the enterprise firewall via the URL Loading System. More... | |
(void) | + disableSecureCommunication |
Disable access across the enterprise firewall via the URL Loading System. More... | |
(BOOL) | + isSecureCommunicationEnabled |
Check whether access across the enterprise firewall via the URL Loading System is enabled. More... | |
(Class) | + getProtocolClass |
Custom protocol class. More... | |
Properties | |
BOOL | supportWKWebView |
Configure WKWebView instances for BlackBerry Dynamics (class property). More... | |
+ (void) enableSecureCommunication |
Call this function to enable, or re-enable access across the enterprise firewall via the URL Loading System.
Access across the enterprise firewall is provided by the BlackBerry Dynamics proxy infrastructure. Only servers that have been specifically listed in the enterprise management console are accessible. See System administration tasks.
Access is enabled by default during authorization processing, which is initiated by the authorize (GDiOS) function. The enableSecure
Communication
function need only be called if access was disabled after authorization, see the disableSecureCommunication function, below.
+ (void) disableSecureCommunication |
Call this function to disable access across the enterprise firewall via the URL Loading System.
Access can be re-enabled using the enableSecureCommunication function. Access will also be re-enabled during authorization processing, which is initiated by the authorize (GDiOS) function.
Calling this function has no impact on access across the firewall using GDHttpRequest (deprecated).
+ (BOOL) isSecureCommunicationEnabled |
Call this function to check whether access across the enterprise firewall via the URL Loading System is enabled.
YES
if access is enabled. NO
otherwise.+ (Class) getProtocolClass |
This function returns an object that is suitable to be included in an NSURLSessionConfiguration
protocolClasses
list.
Note that isn't generally necessary for the application code to manipulate the protocol classes list in a session configuration. This is because the BlackBerry Dynamics runtime configures the list automatically. This function is provided for completeness.
Class
object.
|
readwritenonatomicassign |
The BlackBerry Dynamics runtime checks this property when the application code creates a WKWebView instance.
YES
, the new instance will be configured for BlackBerry Dynamics support. HTTP requests made from the instance may utilize the BlackBerry Dynamics proxy infrastructure. The instance will use the BlackBerry Dynamics secure store to cache data.NO
, the new instance won't be configured for BlackBerry Dynamics.The runtime sets this property to YES
when authorization processing completes with success. Set this property, if required, before creating a WKWebView instance.
Setting this property doesn't change the configuration of WKWebView instances that are already running.
This is a class property.