Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

No longer getting extended profile details on login #111

Closed
andrewbusch7 opened this issue Sep 9, 2015 · 15 comments
Closed

No longer getting extended profile details on login #111

andrewbusch7 opened this issue Sep 9, 2015 · 15 comments

Comments

@andrewbusch7
Copy link

Previously, we used to get the following fields:

  • givenName
  • familyName
  • gender

amongst others in the login response. But now we only get displayName instead of them. Is there a way to still get the above fields, or does G+ no longer offer that?

@andrewbusch7
Copy link
Author

Our QA team also pointed out that it's not asking for the same list of permissions, though unfortunately I don't know that list difference.

@sshadmand
Copy link

I am no longer receiving User Image.

@ashishsajwan
Copy link

+1 .. any workaround for this ???

@markokhman
Copy link

@ashishsajwan @sshadmand @andrewb273 Yeees)
use $http and oauthtoken to request users data

$http.get('https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token='+obj.oauthToken).
                            then(function(response) {
                              console.log(response)
                              // this callback will be called asynchronously
                              // when the response is available'

                            }, function(response) {
                              console.log(response)
                              // called asynchronously if an error occurs
                              // or server returns response with an error status.
                            });

If you don't receive oauthtoken - include 'offline' : true

window.plugins.googleplus.login({
                          // 'scopes': '... ', // optional space-separated list of scopes, the default is sufficient for login and basic profile info
                          'offline': true // optional and required for Android only - if set to true the plugin will also return the OAuth access token, that can be used to sign in to some third party services that don't accept a Cross-client identity token (ex. Firebase)
                          // 'webApiKey': 'api of web app', // optional API key of your Web application from Credentials settings of your project - if you set it the returned idToken will allow sign in to services like Azure Mobile Services
                          // there is no API key for Android; you app is wired to the Google+ API by listing your package name in the google dev console and signing your apk (which you have done in chapter 4)
                        },
                        function (obj) {
                          console.log(obj);
                          var term=null;
                          $http.get('https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token='+obj.oauthToken).
                            then(function(response) {
                              console.log(response)
                              // this callback will be called asynchronously
                              // when the response is available'

                            }, function(response) {
                              console.log(response)
                              // called asynchronously if an error occurs
                              // or server returns response with an error status.
                            });
                          },
                          function (msg) {
                            alert('error: ' + msg);

                          }
                        );

@EddyVerbruggen
Copy link
Owner

Cool, @Markusila, I hope that help others!

@maries-15
Copy link

I couldn't solved the problem adding 'offline': true

$cordovaGooglePlus.login({'offline':true})
.then(function(data){
console.log(JSON.stringify(data))
}, function(error){
console.log("error")
});

I am still receiving email only

@markokhman
Copy link

@maries-15 show me some more code, i'll try to help you

@maries-15
Copy link

@Markusila it is all my code.
what do you want to see exactly?

@SidMehta
Copy link

SidMehta commented Dec 6, 2015

@Markusila I am using the workaround you mentioned. But I am "Failed to retrieve token: Unknown" error. I have set up the sha 1 on the developer console properly too.

@sebastialonso
Copy link

@SidMehta I change the scopes parameter to 'profile' and I only get the same response that you mention. Without any scope, I only get the email. It's really frustrating!

Can the maintainer @EddyVerbruggen shed some light about this critical issue?

@sammugg
Copy link

sammugg commented Mar 30, 2016

Hey @andrewb273, @SidMehta, @sebastialonso, and others,

I just merged a significant update yesterday that updated the Android side to use Google Sign-In and refactored plugin usage. The current documentation is up to date with those changes. You should check it out.

Please note that part of the refactoring meant more clearly defining the plugin's goals, said goal being to authenticate and identify a user through Google. That means that further user information or API access is per use case and on the developer to implement.

Let me know if you have any questions!

Happy Coding,
~Sam
P.S. If your issue gets resolved, please close it!

@sebastialonso
Copy link

Awesome, I'll try it tonight and report back.
Thanks!
On 30 Mar 2016 17:41, "Sam Muggleworth" notifications@github.com wrote:

Hey @andrewb273 https://github.com/andrewb273, @SidMehta
https://github.com/SidMehta, @sebastialonso
https://github.com/sebastialonso, and others,

I just merged a significant update yesterday that updated the Android side
to use Google Sign-In and refactored plugin usage. The current
documentation
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/blob/master/README.md
is up to date with those changes. You should check it out. Let me know if
you have any questions!

Happy Coding,
~Sam
P.S. If your issue gets resolved, please close it!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#111 (comment)

@andrewbusch7
Copy link
Author

All good from my end, will close this issue

@vivekpd15
Copy link

Hi,

How did you guys manage to get the gender using the new flow?

@sammugg
Copy link

sammugg commented Apr 7, 2016

Hey @vivekpd15, refer to our documentation to learn about what is being returned from this plugin.

Also, if you have additional questions, please open a separate ticket as this one has been closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants