restkit is using in a different way the oauth2 protocol, I need to change the code to be able to use it in my way:
From:
// OAuth 2 valid request
if (self.authenticationType == RKRequestAuthenticationTypeOAuth2) {
NSString *authorizationString = [NSString stringWithFormat:@"OAuth2 %@", self.OAuth2AccessToken];
[_URLRequest setValue:authorizationString forHTTPHeaderField:@"Authorization"];
}
to:
// OAuth 2 valid request
if (self.authenticationType == RKRequestAuthenticationTypeOAuth2) {
NSString *authorizationString = [NSString stringWithFormat:@"Bearer %@", self.OAuth2AccessToken];
[_URLRequest setValue:authorizationString forHTTPHeaderField:@"Authorization"];
}
Use of "Bearer" instead of "Oauth2" ....
I'm using CocoaPods to import restkit in my project.
Can I fork Restkit repository on github and use the fork via CocoaPod instead of the official version?
See Question&Answers more detail:os