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
unable to login with no clear error message. #38
Comments
Thank you @kevinhuy for reporting this bug. I try to understand and reproduce the error. So I have some questions:
Best regards Christian |
As phpIPAM only supports api interactions via an encrypted connection without encryption set to `False` we also only supports `https` for connecting to a phpIPAM API instance. If we finally implement the `encryption` feature in not clear now. As `https` connections are industry standard we don't invest much effort in this feature. If anybody needs this feature feel free to contribute or file a feature request where interested can vote on.
Hi Christian,
|
Ok, the root cause is the unencrypted api endpoint. PhpIPAM does not support 'user token' without SSL nor encryption by default. If you don't have set
The bug is that we don't catch the exception correctly. We will fix this asap. If you set |
As the try to connect to an unsecure api endpoint with user token leads to an exception we need to adapt our exception handling to print out the full and correct information. As `https` connections are industry standard we don't invest much effort in implementation of the `encryption` feature. If anybody needs this feature feel free to contribute or file a feature request where interested can vote on.
As phpIPAM does not support `User token` via `http` by default we need to adapt our documentation to reflect these fact.
@cmeissner thanks for your feedback , i will wait on your fix then. |
@kevinhuy finally I pushed the changes that are needed for that bug. It would be great if you can test it and gave us feedback in form of a review. |
@cmeissner did you push the change on pip or i need to clone the repo ? |
I only pushed it to develop here. After getting required reviews a new version will be created and published on you. |
ok i just test it works, i m able to pull the info . :) |
Hello,
I m trying to test phpypam with the sample provide.
pi = phpypam.api(
url='http://myipam.com',
app_id='xx',
token='xxxxx',
username='xxx',
password='xxx',
ssl_verify=False
)
pi.get_entity(controller='sections')
And i got the following error
Traceback (most recent call last):
File "test_ipam.py", line 10, in
ssl_verify=False
File "/lib/python3.6/site-packages/phpypam/core/api.py", line 66, in init
self._login()
File "/lib/python3.6/site-packages/phpypam/core/api.py", line 131, in _login
resp = self._query(method=POST, auth=_auth)
File "/lib/python3.6/site-packages/phpypam/core/api.py", line 121, in _query
raise PHPyPAMException(code=result['code'], message=result['message'])
phpypam.core.exceptions.PHPyPAMException
Versions:
The text was updated successfully, but these errors were encountered: