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

Update GoDaddy login method. Addresses issues #12 and #17 #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions HISTORY.rst
@@ -1,3 +1,8 @@
0.2.3 (2015-08-26)
++++++++++++++++++

* Fixed for GoDaddy's new auth method (thanks to @claneys and @BryceGough)

0.2.0 (2015-03-11) 0.2.0 (2015-03-11)
++++++++++++++++++ ++++++++++++++++++


Expand Down
14 changes: 4 additions & 10 deletions pygodaddy/client.py
Expand Up @@ -97,17 +97,11 @@ def login(self, username, password):
:returns: `True` if login is successful, else `False` :returns: `True` if login is successful, else `False`
""" """
r = self.session.get(self.default_url) r = self.session.get(self.default_url)
try:
viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1)
except:
logger.exception('Login routine broken, godaddy may have updated their login mechanism')
return False
data = { data = {
'Login$userEntryPanel2$LoginImageButton.x' : 0, 'app' : 'idp',
'Login$userEntryPanel2$LoginImageButton.y' : 0, 'realm' : 'idp',
'Login$userEntryPanel2$UsernameTextBox' : username, 'name': username,
'Login$userEntryPanel2$PasswordTextBox' : password, 'password' : password,
'__VIEWSTATE': viewstate,
} }
r = self.session.post(r.url, data=data) r = self.session.post(r.url, data=data)
return self.is_loggedin(r.text) return self.is_loggedin(r.text)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -23,7 +23,7 @@


setup( setup(
name='pygodaddy', name='pygodaddy',
version = '0.2.2', version = '0.2.3',
description = '3rd Party Client Library for Manipulating Go Daddy DNS Records.', description = '3rd Party Client Library for Manipulating Go Daddy DNS Records.',
long_description=open('README.rst').read()+'\n\n'+open('HISTORY.rst').read(), long_description=open('README.rst').read()+'\n\n'+open('HISTORY.rst').read(),
url = 'https://github.com/observerss/pygodaddy', url = 'https://github.com/observerss/pygodaddy',
Expand Down