GTMOAuth2ViewControllerTouch *viewController;
viewController = [[GTMOAuth2ViewControllerTouch alloc] initWithScope:scope
clientID:kMyClientID
clientSecret:kMyClientSecret
keychainItemName:kKeychainItemName
delegate:self
finishedSelector:@selector(viewController:finishedWithAuth:error:)];
[self presentModalViewController:viewController
- (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController
finishedWithAuth:(GTMOAuth2Authentication *)auth
error:(NSError *)error {
[self dismissModalViewControllerAnimated:YES];
if (error != nil) {
// Authentication failed
NSLog(@"error description%@",error.description);
} else {
// Authentication succeeded
signedIn = true;
[[self domainService] setAuthorizer:auth];
auth.authorizationTokenKey = @"id_token";
NSLog(@"\n accessToken value is %@",auth.accessToken);
[self showEnterPinDialogue:auth.userEmail isConfirmEnable:true];
}