0

I am currently working with Google API with Objective C and OAuth 2.0 api is giving me a headache whole day

I have been looking at google's documentation

And I have managed to get to a stage where I can login and 'Allow Access'

The issue arises the following step.

From API, I get Authentication Token. and according to the documentation I'm following ( link above)

I can authorise the request with method

[auth authorizeRequest:myNSURLMutableRequest
          delegate:self
 didFinishSelector:@selector(authentication:request:finishedWithError:)];

then I have no idea what 'myNSURLMutableRequest' is.

Any advice so much appreciated

By the way I am going to work with Google Task API

hsb1007
  • 119
  • 8

2 Answers2

1

You can use a existing library to use a service with OAuth protocol. You don't have to reinvent the wheel !

https://github.com/leebyron/cocoa-oauth2

https://github.com/lukeredpath/LROAuth2Client

Arnaud
  • 539
  • 6
  • 14
  • Thanks!! but any idea what the request would be? – hsb1007 Nov 15 '12 at 22:55
  • I've never use OAuth 2.0. Only the 1.0. I don't want to tell you something wrong. You can take a look at Google documentation : https://developers.google.com/accounts/docs/OAuth2InstalledApp – Arnaud Nov 16 '12 at 09:07
0

Use this method to setback your saved auth object from keychain

GTMOAuth2Authentication *authObj; authObj = [GTMOAuth2ViewControllerTouch authForGoogleFromKeychainForName:kKeychainItemName clientID:GoogleClientID clientSecret:GoogleClientSecret];

BOOL isSignedIn = [authObj canAuthorize];

Madhuri
  • 178
  • 1
  • 9