android - Logging in with G+ - why scope "plus.login" won't work alone? -
i have gone through dozens of answers on topic, followed official quick start guide, , done think of.
i have set google developer console in parts, including setting right debug sha1 keys both oauth , public api access (don't know if necessary).
issue
i have issues setting scopes googleapiclient
.
googleclient = new googleapiclient.builder(this) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .addapi(plus.api) .addscope(...) .build();
i can login different combinations of scopes:
.addscope(new scope("https://www.googleapis.com/auth/plus.login")) .addscope(new scope("https://www.googleapis.com/auth/plus.profile.emails.read")) //works! or: .addscope(plus.scope_plus_login) // == https://www.googleapis.com/auth/plus.login .addscope(plus.scope_plus_profile) // == https://www.googleapis.com/auth/plus.me //works! or: .addscope(new scope("https://www.googleapis.com/auth/plus.profile.emails.read")) //works! or: .addscope(plus.scope_plus_profile) // == https://www.googleapis.com/auth/plus.me //works!
they work , see them reflected in requests (i.e., if set login
+ emails.read
, dialog ask these two).
however, need "https://www.googleapis.com/auth/plus.login". if set .addscope(new scope("https://www.googleapis.com/auth/plus.login"))
, or equivalently, .addscope(plus.scope_plus_login)
, encounter well-document toast error:
internal error occurred.
so scope (the 1 need) works in conjunction others (e.g. plus.me), not alone. why that, , can do?
you can replace code following worked me.
mgoogleapiclient = new googleapiclient.builder(this) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .addapi(plus.api, plus.plusoptions.builder().build()) .addscope(plus.scope_plus_login).build();
Comments
Post a Comment