All authorizations are done through the
AFNetworking library. The authorizations are mentioned in the following sections.
To authorize against the basic (or the simplest) authorization:
// client is instance of AFHTTPClient [client setAuthorizationHeaderWithUsername:@"username" password:@"password"];
The token-based authorization is mostly used with OAuth 1.0 / OAuth 2.0 authorization schemes. After authorizing with them, you will get a token string, which you need to supply to your
// client is instance of AFHTTPClient NSString *token = @"1q2w3e4r"; [client setAuthorizationHeaderWithToken:token];
setAuthorizationHeaderWithToken method actually sets an HTTP header
Authorization with the
Token token=1q2w3e4r ...