Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force init to throw an error if the user is not a Google+ User #23

Open
mohamedmansour opened this issue Apr 10, 2012 · 6 comments
Open
Labels

Comments

@mohamedmansour
Copy link
Owner

Right now, if the user is a Google Accounts user, but not a Google+ user, the API doesn''t know about it. We should somehow figure out if the current session is indeed a Google+ user, if not, we should throw an error back within the callback response.

@ryanpeggs
Copy link

You can use the INITIAL_DATA_API to get the user's Google ID once they have logged in. If you then issue a get request for that user ID (using the PROFILE_GET_API), it will return :

)]}'

[["er",,,,["op.er","REDIRECTED","/me/createprofile/"]
,200,"op.er"]
]

if the account does not have a public profile. Loading https://plus.google.com/up/accounts/upgrade/ will allow a user to create a profile and the session will become valid after the process has been completed.

@ryanpeggs
Copy link

Fixed in #31

@mohamedmansour
Copy link
Owner Author

That is true, but I analyzed intial_data and saw that no public profiles have no ACL, maybe we can assume no ACL = not Google+ user. I am evne wondering that we can remove the get request for plus.google.com and get all the info we need from INITIAL_DATA_API instead.

@ryanpeggs
Copy link

Using INITIAL__DATA_API with key 1 rather than 14 returns JSON that contains the session authentication. The format is the same as part of the plus.google.com response so you can simply replace the url : plus.google.com with https://plus.google.com/${pagetoken}/_/initialdata?key=1 and the parsing code continues to work.

EDIT: the authentication key is also present using key 14, at the end of the response.

@mohamedmansour
Copy link
Owner Author

Ah sweet, we will do that then! :)

@mohamedmansour
Copy link
Owner Author

does this still work?

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

No branches or pull requests

2 participants