pygooglevoice icon indicating copy to clipboard operation
pygooglevoice copied to clipboard

Change 'User-Agent' or allow customization of it

Open rtaft opened this issue 8 years ago • 7 comments

The 'User-Agent' content is set to PyGoogleVoice/0.5. Every time I send an SMS message using PyGoogleVoice, I get a separate email asking me to verify that the login was really me. Even after I say yes, it sends a verification email with the next use of it. I ended up replacing my User-Agent with the following to get around it (which came from my browser): Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36 It would be nice if there were a more permanent solution, or a config entry to set it manually.

rtaft avatar Nov 03 '16 17:11 rtaft

You need to enable less secure apps in google.

kb9mwr avatar Nov 26 '16 00:11 kb9mwr

I already have it enabled. This shows up as 'New sign-in on Unknown OS' in the security events even with it enabled.

rtaft avatar Nov 28 '16 15:11 rtaft

Would you need each user be able to set their own user agent.

chris001 avatar Feb 10 '17 19:02 chris001

No, it just needs to be set to something that doesn't trigger the security notifications in the code.

rtaft avatar Feb 10 '17 19:02 rtaft

OK because there's a way to have it be per-user or one setting for all users. The problem with one setting for all users is the browser versions change over time, while that one browser version would be stuck at the browser version selected today. Eventually a user will most likely want to change that browser version to match, for example, their actual browser version that they normally use when logging into gv from their computer, so that it doesn't trigger a security warning for "new browser detected during login". So it's a dilemma.

chris001 avatar Feb 10 '17 20:02 chris001

Ah, I see what you mean now. I suppose it depends on Google Voice. If there is a single line for all users, will you only get a security message during the first SMS and then none after accepting it, or will you get a message after every SMS like "PyGoogleVoice/0.5" does? If you do it user based, then I assume that this is a 3rd party app running on a server that is not the users own desktop or coming from the users own IP. In that case would you still get a security message even if you manually change the User Agent, and if so, would you get it once, or multiple times? In my case, the service is running on the same computer and network that I have an authorized browser on using that browsers User-Agent.

rtaft avatar Feb 10 '17 20:02 rtaft

The only way to find out whether a real browser user-agent will cause one security message or an endless stream of them, is to try it. GV seems to alert you any time it appears your account is being logged into by someone other than you, the way it decides it's someone else is, it determines if the login is from a previously unseen device, browser/operating system, or possibly from a far away, new IP address/location. Currently however gv login is temporarily broken due to the shiny new version of the gv web login page which has shifted things around slightly. Is login working for you?

chris001 avatar Feb 10 '17 21:02 chris001