Fix login
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
corenetworks-credentials.ini
|
corenetworks-credentials.ini
|
||||||
.python-version
|
.python-version
|
||||||
**.pyc
|
**.pyc
|
||||||
|
certbot-test
|
||||||
Binary file not shown.
@@ -62,7 +62,9 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||||||
|
|
||||||
def _get_corenetworks_client(self):
|
def _get_corenetworks_client(self):
|
||||||
return _CoreNetworksAPIClient(
|
return _CoreNetworksAPIClient(
|
||||||
self.credentials.conf("login"), self.credentials.conf("password"), self.ttl
|
self.credentials.conf("username"),
|
||||||
|
self.credentials.conf("password"),
|
||||||
|
self.ttl,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -71,8 +73,8 @@ class _CoreNetworksAPIClient:
|
|||||||
Encapsulates all communication with the Core Networks API.
|
Encapsulates all communication with the Core Networks API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, login, password, ttl):
|
def __init__(self, username, password, ttl):
|
||||||
self.login = login
|
self.username = username
|
||||||
self.password = password
|
self.password = password
|
||||||
self.ttl = ttl
|
self.ttl = ttl
|
||||||
self.token = None
|
self.token = None
|
||||||
@@ -83,9 +85,11 @@ class _CoreNetworksAPIClient:
|
|||||||
return self.token
|
return self.token
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
print(self.username)
|
||||||
|
print(self.password)
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{API_BASE_URL}/auth/token",
|
f"{API_BASE_URL}/auth/token",
|
||||||
json={"login": self.login, "password": self.password},
|
json={"login": self.username, "password": self.password},
|
||||||
timeout=30,
|
timeout=30,
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user