android - Google Play Services for Cloud based apps? -


i want avoid using webviews oauth tokens google. (asking user share contacts, profile info etc). used google play services apis that.

since app cloud based (logic happens in cloud), have save these tokens in cloud. have let user sign in multiple devices (without asking him google permissions every time logs in new device)

i tried implement technique mentioned in google blog.

i tried hands on method mentioned in blog. did not work wished. checked +tim bray's google code project (favcolor-accountchooser) , had following code.

        try {             // if works, token guaranteed usable             token = googleauthutil.gettoken(favcolormain.this, memail, scope);          } catch (userrecoverableauthexception userauthex) {             startactivityforresult(userauthex.getintent(), authutil_request_code);             token = null;          } 

it conflicts concept mentioned in blog. 'token string' obtained not sent server , in exception block, further permissions (scopes) asked user. snippet imply?

also, role of 'web app' along? don't see being of use other being mentioned in scope parameter.

another major issue

for example app takes contacts permission multiple google ids , merges duplicates , gives unified contacts list. now, magic happens in servers , servers ones need tokens.

my android app uses google play services apis , gets user permissions multiple google accounts (to read contacts). how pass there tokens web app ( through https connection?). can't web app under same project these tokens once user grants permission android app (under same project)?.

if install same app on android phone, have again ask user give me permission accessing contacts each of accounts, (even though has given me permission before), since there no actual concept of 'login' here. tokens has sent mobile server.

alternative: have use web view , directly tokens cloud apps, instead of using google play services sdk, counter intuitive. (in our +friday app, maximum user drop outs happen on web view screen).

actually, if closely, token value passed mcustomer.execute(), example in fetcher.java, packs in json , sends off back-end post. “web app” should registered client id of back-end you’re going send id token to.

yes, can pass tokens web app , use them on end. remember use https whenever you’re doing kind of thing.

we’re working on making approval stickier, if particular user/scope combination on 1 android, should work on others too. see https://developers.google.com/accounts/docs/crossclientauth


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -