Client-side authentication with google+ for iOS on azure mobile service backend -
i'm trying integrate server-side side google+ sign-in ios app.
this did:
func application(application: uiapplication, openurl url: nsurl, sourceapplication: nsstring?, annotation: anyobject) -> bool { return gppurlhandler.handleurl(url, sourceapplication: sourceapplication, annotation:annotation) }
// in view controller @iboutlet weak var gploginview: gppsigninbutton!
googleplus = gppsignin.sharedinstance() googleplus.shouldfetchgoogleplususer = true googleplus.clientid = "client-id" googleplus.homeserverclientid = "home-client-id" googleplus.scopes.append(kgtlauthscopepluslogin) googleplus.delegate = self; func finishedwithauth(auth: gtmoauth2authentication!, error: nserror!) { if error != nil { println("[googleauthentication] error: \(error)") } else { var servercode = gppsignin.sharedinstance().homeserverauthorizationcode if servercode == nil { println("[googleauthentication] homeserverauthorizationcode missing") googleplus.disconnect() } else { client.loginwithprovider("google", token: ["access_token" : servercode]) { user, error in println("[azure::loginwithtoken] result. user=\(user). error=\(error).") } } } }
my have 2 credentials in google developer console. 1 ios application , web application. clientid ios application specified in googleplus.clientid. clientid web application specified in homeserverclientid. also, same clientid , secret specified in azure mobile service identities configuration.
also url schema created name of application bundle.
i client portion of authentication passed , able homeserverauthorizationcode, when try server side portion error azure mobile service. error is: error domain=com.microsoft.windowsazuremobileservices.errordomain code=-1301 "the server returned error." userinfo=0x170464c80 {nslocalizeddescription=the server returned error.}.
please figure out doing wrong?
thanks, ruben
Comments
Post a Comment