-
Notifications
You must be signed in to change notification settings - Fork 99
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
Issues with login into a Cloud Key Gen2 plus #62
Comments
@finish06 , I think this is fixed in the |
Here to express my excitement for a new release from dev branch! :) |
FYI: v2.21 has been uploaded to PyPi and is reported to have fixed these issues. Let me know what you find. Thanks. |
Tested it out today with a USG4 and a Cloud Key Gen 2, and unfortunately the 401 issue still exists. Is there a sample I can provide from my Unifi setup that will help? |
@mgottholsen - I do not have a CloudKey. Can you confirm the URL that is being accessed when logging into the CloudKey? Also, please provide the software version on the CloudKey2. |
Just wanted to say that I can use pyunifi (2.21 version) with my CK+ when I set version to UDMP-unifiOS. |
I tried to use pyunifi against a Cloud Key Gen2 plus, and I found a login issue to it.
I tried to use version="unifiOS" and then I got this error back:
raise APIError("Login failed - status code: %i" % r.status_code)
APIError: Login failed - status code: 401
I used F12 to login to the cloud key, and checked which URI it posted the login call to.
It is supposted to be towards: https://IP/api/auth/login.
In the script, the self.url is:
self.url = 'https://' + host + '/proxy/network/'
and the login function is using self.url like this:
login_url = self.url + 'api/login'
Which means it gets /proxy/network/ before api/login.
So I changed the init from:
if version == "unifiOS":
self.host = host
self.username = username
self.password = password
self.site_id = site_id
self.ssl_verify = ssl_verify
self.url = 'https://' + host + '/proxy/network/'
to:
if version == "unifiOS":
self.host = host
self.username = username
self.password = password
self.site_id = site_id
self.ssl_verify = ssl_verify
self.url = 'https://' + host + '/proxy/network/'
self.urllogin= 'https://' + host + '/'
self.version=version
And the login function I changed from this:
def _login(self):
log.debug('login() as %s', self.username)
To:
def _login(self):
log.debug('login() as %s', self.username)
And then I could login to the Cloud key and pull everything I needed.
Just wanted to inform you about this issue, awesome job with the library!
The text was updated successfully, but these errors were encountered: