while creating application session for google oauth 2 for ios returns invalid_grant -


i'm using google's oauth2.0 process let users sign within ios app.

after gtmoauth2viewcontrollertouch returns gtmoauth2authentication still have create own application session backend. know flow our website working.

i tried validate session posting gtmoauth2authentication auth code google i'll 400 invalid_grant error. (for testing porpuses used objective-c post handled our backend)

nsdictionary *data = @{                            @"code":googleauthcode,                            @"redirect_url":@"urn:ietf:wg:oauth:2.0:oob",                            @"client_secret":sd_oauth_client_secret,                            @"client_id":sd_oauth_client_id,                            @"grant_type":@"authorization_code"                            };   afhttpclient *google = [[afhttpclient alloc] initwithbaseurl:[nsurl urlwithstring:@"https://accounts.google.com"]];  nsstring *path = @"/o/oauth2/token"; [google postpath:path parameters:data success:^(afhttprequestoperation *operation, id responseobject) {     nslog(@"responseobject %@", responseobject); } failure:^(afhttprequestoperation *operation, nserror *error) {     nslog(@"failed %@",error); }];` 

any suggestion how create application session?

thanks

did try use gtm-oauth2 library: https://code.google.com/p/gtm-oauth2/

also check documentation there: https://code.google.com/p/gtm-oauth2/wiki/introduction


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -