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

Login fails. Anyone able to login? #27

Open
chris001 opened this issue Sep 27, 2016 · 68 comments
Open

Login fails. Anyone able to login? #27

chris001 opened this issue Sep 27, 2016 · 68 comments

Comments

@chris001
Copy link

chris001 commented Sep 27, 2016

Using the master version from this repo.
It gives the login failure error.

~# gvoice send_sms +18005551212 "Test Message... "
Login failed. Retry?[Y/n]

When you run sms.py to get a stack trace it says:

~/pygooglevoice/examples # python sms.py
Traceback (most recent call last):
  File "sms.py", line 5, in <module>
    voice.login()
  File "/usr/lib/python2.7/site-packages/googlevoice/voice.py", line 96, in login
    raise LoginError
googlevoice.util.LoginError

The code raising the exception is in voice.py line 96

        try:
            assert self.special
        except (AssertionError, AttributeError):
            raise LoginError

From #21 #22 and #24 it makes no difference when you modify the LOGIN url in settings.py to remove all get parameters except service=grandcentral :

#LOGIN = 'https://accounts.google.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open'
LOGIN = 'https://accounts.google.com/ServiceLoginAuth?service=grandcentral'

Anyone else getting this Login Failed error ?

Could the login be failing because this code is using both GET and POST parameters, while the login web page itself uses only POST parameters ?

@chris001 chris001 changed the title Login fail Login failed. Retry? Sep 27, 2016
@chris001 chris001 changed the title Login failed. Retry? Login failed. Assert self.special fails. Sep 28, 2016
@chris001 chris001 changed the title Login failed. Assert self.special fails. Login fails. Anyone able to login? Sep 28, 2016
@tom-slick
Copy link

Code works as is with no changes.
Did you get everything right in your .gvoice file?

[auth]
# Google Account email address (one associated w/ your Voice account)
email=name@gmail.com

# Raw password used or login
password=password

[gvoice]
# Number to place calls from (eg, your google voice number)
forwardingNumber=+12223334444

# Default phoneType for your forwardingNumber as defined below
#  1 - Home
#  2 - Mobile
#  3 - Work
#  7 - Gizmo
phoneType=2


@chris001
Copy link
Author

chris001 commented Sep 28, 2016

@tom-slick
Thanks for replying.
Yes the .gvoice file looks exactly like yours.
One discrepancy - this gmail account started its life as a simple google account with name@yahoo.com as the associated email, and later, added to the account a name@gmail.com address and a gmail inbox.
And the name@gmail.com address was set as the primary email on the account.
You can login as either email address.
Could this be why it's behaving differently to the point where it's failing the login??

@tom-slick
Copy link

I don't know. I'm not in that situation so I could not even test that.

@chris001
Copy link
Author

@tom-slick
I tested it with a different google gmail account, this one has only a name@gmail.com address, no other previous outside email address associated to it, and it still fails :/
Had to visit this page to accept the new device and IP address, for security, since the pygooglevoice code is running on a different IP than usual PC. https://security.google.com/settings/security/activity

@tom-slick
Copy link

I did a clean install of the software (no changes to the download) and then created the auth file and it logged in without errors on the first try. It's not the code, it does work.

@chris001
Copy link
Author

@tom-slick Which operating system and python version are you running? Just to check... Here it's centos 7 and python 2.7

@tom-slick
Copy link

Debian and Raspbian. python 2.7

@chris001
Copy link
Author

chris001 commented Sep 28, 2016

Thanks @tom-slick 🍻
FYI for anyone else with this issue. The master code from this pettazz repo is logging in fine, in debian raspbian and centos 7 OS.
The problem that was preventing it from logging in, was a google voice account security captcha.
To pass it, you must login on a browser and click a button.
You must do this "gvoice reset procedure", which allows the gvoice app to login from the new "Device," when you're running this code on a device which is different device from your usual pc/device.
GVoice reset procedure:
https://accounts.google.com/DisplayUnlockCaptcha

Allow access to your Google account
As a security precaution, Google may require you to complete this additional step when signing into a new device or application.

To allow access, click the Continue button below.

This was referenced Sep 28, 2016
@nalipaz
Copy link

nalipaz commented Nov 23, 2016

None of this is working for me. Still can't login on arm architecture, debian 8. Trying with python2.7 right now.

@nalipaz
Copy link

nalipaz commented Nov 23, 2016

BTW, I see the code in voice.py that should prompt for an smsKey when unset, that never happens. I also tried setting smsKey in my .gvoice file and that doesn't help. 2-factor authentication still seems broken. Visiting the above url does not prompt for a captcha to unlock and instead only provides me with a continue link. Also, I have tried this both with my real password as well as an app password.

@chris001
Copy link
Author

@nalipaz
The url https://accounts.google.com/DisplayUnlockCaptcha is supposed to only show a Continue button, all it does is allow the IP address you're browsing on, to have permission to login to the GVoice account.

@chris001 chris001 reopened this Nov 24, 2016
@chris001
Copy link
Author

@nalipaz Did you visit the link from the web browser on the Debian 8 ARM machine - or if you're behind a NAT router on a shared IP, from a device on only wifi link to the router, ie, with 3g/4g cellular data disabled,

@chris001
Copy link
Author

chris001 commented Nov 24, 2016

@nalipaz
Just tested gvoice send_sms 18005551212 Hello trying out the send_sms right now and it still works on Centos 7 Python 2.7.5.
~/.gvoice contains email= account email, password= the raw clear text password, and phoneType=2 for Mobile.
smsKey is not necessary for you to provide, the app gets that key by itself while it talks to gvoice, as part of its login.
What's the error it gives you, can you copy and paste it.

@nalipaz
Copy link

nalipaz commented Nov 25, 2016

Turns out it is all related to two-factor authentication not working, reported in another issue.

@dzimbeck
Copy link

dzimbeck commented Feb 9, 2017

Unlock Captcha doesn't work either

@chris001
Copy link
Author

@dzimbeck How about if you disable two-factor authentication on the google account settings. Then will it let you login?

@dzimbeck
Copy link

There is no two factor authentication set.
I've tried with multiple Gmail. So has a friend of mine on other computers. This package used to work for us, now it doesnt.

Please test it and patch it.

@dzimbeck
Copy link

It broke recently out of nowhere. I submitted a new issue. Google probably changed something again.

@chris001
Copy link
Author

Here the login worked on 8th and 9th Feb, and is broken today 10th Feb.

@chris001
Copy link
Author

They released a nicer web interface, with slight changes.

@dzimbeck
Copy link

It wasn't working for us on the 9th either. We just get perpetual Auth errors regardless of email, I always get a notification at my gmail when it fails logging in. Even unlock captcha, nothing seems to work.

Did they change their login url again?

@chris001
Copy link
Author

Further information: The code actually logs in, but it thinks that the login failed. Probably due to the change in the web interface text. Looking into it..
Run the app, then see for yourself that you have logged in successfully, by visiting here, it will say the user agent of your app, "recently used devices - just now - new":
https://myaccount.google.com/device-activity?pli=1

@dzimbeck
Copy link

Thank you for noticing this! This is exactly what I'm seeing. But the main question is, can a patch be applied so that the library can text and call again and not think it's login has failed? I've got it in a try/except catch. I could change my code but will it actually text if I ignore this error? It makes more sense to push a fix and eventually close this issue.

@chris001
Copy link
Author

That's interesting, the same commands in the same order are working fine here.
What happens after you edit settings.py and set Debug = True and try gvoice, sms, inbox again.

@dzimbeck
Copy link

So is this package still broken?

@dov1
Copy link
Contributor

dov1 commented Mar 19, 2017 via email

@dov1
Copy link
Contributor

dov1 commented Mar 19, 2017

Oops. I forgot to remove the quoted text before sending reply.

@chris001
Copy link
Author

@dov1 I thought the package was still broken when you do the commands sms then inbox ?? Is that series of commands working now for you? What have you changed to get those commands to work for you?

@dov1
Copy link
Contributor

dov1 commented Mar 19, 2017 via email

@chris001
Copy link
Author

You can make a small change to the code to see more information about why it's crashing there.
At line 181 of /usr/lib/python2.7/site-packages/googlevoice/util.py, it was:
assert is_sha1(id), 'Message id not a SHA1 hash'
Comment that out, and put these two lines:

#assert is_sha1(id), 'Message id not a SHA1 hash'
assert type(id) is StringType, "Message ID is not a string: %r" % type(id)
assert is_sha1(id), "Message ID not a SHA1 hash: %r" % id

@sshanmu3
Copy link

@dov1
When I am trying to place a call without giving forwardingNumber then the call is not working and shows following error. But works fine when I have forwardingNumber used in my code.
Please provide solution to place a call without providing the forwardingNumber.

File "C:\Python27\lib\site-packages\googlevoice\voice.py", line 158, in call
'remember': '1'
File "C:\Python27\lib\site-packages\googlevoice\voice.py", line 289, in __validate_special_page
load_and_validate(self.__do_special_page(page, data))
File "C:\Python27\lib\site-packages\googlevoice\util.py", line 70, in load_and_validate
validate_response(loads(response.read()))
File "C:\Python27\lib\site-packages\googlevoice\util.py", line 64, in validate_response
raise ValidationError('There was a problem with GV: %s' % response)
googlevoice.util.ValidationError: There was a problem with GV: {u'data': {u'code': 1}, u'ok': False}

@dov1
Copy link
Contributor

dov1 commented Mar 20, 2017 via email

@sshanmu3
Copy link

@dov1
I have my google voice number which is linked with my mobile phone number.
If I remove the linked mobile number from google voice account then placing the call not working.
If my google voice number have linked number then my code able to place the call without any issue.
Is google voice reacquires linked phone number to place the call?
Suppose my google voice number is NOT Linked with any external phone number then can we not place a call via Hangouts?

@dov1
Copy link
Contributor

dov1 commented Mar 20, 2017 via email

@chris001
Copy link
Author

@sshanmu3
Did that used to work? With a previous version, were you able to place a call with this script, and have it ring the called party, at the same time as ring your Hangouts app for you to pick up?

@dov1
Copy link
Contributor

dov1 commented Mar 20, 2017

It's possible to have Google ring numbers and hangouts at the same time but I don't think pygooglevoice was able to place a call using Hangouts at any time.

Although I don't remember the click to call function being able to use Google Chat, I see that Google did add the option to use Hangouts. Should be something interesting to look into. This might be possible.

@sshanmu3
Copy link

@chris001
I am using latest updated file Settings.py. The master version had login issue.
The current version works fine when I have google voice number has linked number.The call comes to my phone first and ring goes to called party. I did not try calling hangout app.

@chris001
Copy link
Author

@sshanmu3 Just so you know, the current master version was fixed 10 days ago, and it has the update (to the settings.py) which fixed the login issue.
And so in answer to my question, you've never used this python program to place a call between a non-forwarded google voice number (which is the same thing as the Hangouts app) and your called party. It's good to know this.

@chris001
Copy link
Author

@dov1 @numericOverflow @tom-slick
I'm getting a login error today. On 2 different gvoice accounts, using password login.
Is it crashing for you too?

$ gvoice send_sms +18005551212 Test Message...
Traceback (most recent call last):
  File "/usr/bin/gvoice", line 79, in <module>
    login()
  File "/usr/bin/gvoice", line 49, in login
    voice.login(options.email,options.passwd)
  File "/usr/lib/python2.7/site-packages/googlevoice/voice.py", line 75, in login
    galx = re.search(r"type=\"hidden\"\s+name=\"GALX\"\s+value=\"(.+)\"", content).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

@dov1
Copy link
Contributor

dov1 commented May 21, 2017

I didn't notice any problem placing calls. I rarely use the script for sms. I can test it later or tomorrow.

@kenttse
Copy link

kenttse commented May 21, 2017

I am able to login (right now) and send sms, using the exact command you used @chris001.

@chris001
Copy link
Author

@dov1 @kenttse
The only reason I can think of to explain why your login worked with the March 2017 code, and my login crashed, is maybe because I'm in a different geographical area from you, and have received the updated ARIA AngularJS login site before you. When you view it using the web browser, does it look like you are still on the older gvoice site (first version AngularJS)? Which geographical area are you in?

@MrCreosote
Copy link

@chris001 FWIW I see the same error when running gvoice login and entering the email address + pwd at the prompts. This is with a brand new pip install of pygooglevoice 0.5.2 on Ubuntu 14.04.

@chris001
Copy link
Author

@MrCreosote What's the pip install command you used

@MrCreosote
Copy link

@chris001 sudo pip install pygooglevoice

@chris001
Copy link
Author

@MrCreosote
The version on pypi was uploaded to pypi on Aug 24, 2016. It's way out of date.
You can download the one from my organization's repo it's the most up to date.
To do this, you just run these commands:

cd ~
git clone https://github.com/EspaceNetworks/pygooglevoice
cd pygooglevoice
pip install -r requirements.txt
python setup.py install
cp -p bin/gvoice /usr/bin/.
exit

@gpratt3151
Copy link

If you're getting login failures try commenting the smsKey= line in your .gvoice file unless you'have a value for it:

# Optional 2-step authentication key (as provided by Google)
#smsKey=

It seems that once I logged in properly one time or after some timeout period, logins started working. I cannot confirm definitively that commenting the smsKey is the solution, though.

@chris001
Copy link
Author

@gpratt3151
Thanks. I've logged in OK with smsKey= as it is, not commented, so it's probably not that.
I think you need to do the DisplayUnlockCaptcha ("DUC") page, it's required before logging in from a new IP address and/or new device or app.
https://accounts.google.com/DisplayUnlockCaptcha

@Abolfazl
Copy link

I kept getting an error on assert self.special. I took @dov1's suggestion and hardcoded the _rnr_se value. To find this value, you go to https://www.google.com/voice/b/0#inbox and then view the source and search for _rnr_se. You will see a line that looks like <input name="_rnr_se" type="hidden" value="nYSv//pGk54MpzGyuHthW/XXX="/>. In voice.py, change the sp variable in special() to be equal to this instead of the pattern.search(resp).group(2)

@chris001
Copy link
Author

@Abolfazl
By getting an error on assert self.special this means your login failed for security reasons most likely you're running this, and so it's trying to login, from a device/IP address where it hasn't previously run. Try the DUC page ( https://accounts.google.com/DisplayUnlockCaptcha ), then try the command line again, it should work, post back here your results.

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

No branches or pull requests

10 participants