+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Objective-C custom resource-request implementation sample

An Objective-C sample for acquiring data from a protected resource by using the MobileFirst WLAuthorizationManager class.

The sample contains two methods of a class that implements NSURLConnectionDelegate. The sample implements a standard OAuth flow: first, a resource request is sent without an access token. This request is expected to fail with an authorization error. Then, WLAuthorizationManager is used to obtain an access token for the resource's protecting scope, and the request is sent again with the obtained access token as an authorization header. The resource request is created by using a standard NSMutableURLRequest object.

Parent topic: Sample custom resource-request implementations using WLAuthorizationManager