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

authentication fails when password contains & character #9

Open
lebeno opened this issue Jan 12, 2023 · 1 comment
Open

authentication fails when password contains & character #9

lebeno opened this issue Jan 12, 2023 · 1 comment

Comments

@lebeno
Copy link

lebeno commented Jan 12, 2023

Authentications fails when the username or password contains a special character like &

Probably caused because the login method of class HttpApi in aos.py does not escape username and password:

path = '/v1/api/login?username='+username+'&password='+password

Possible solution:

import urllib.parse

class HttpApi(HttpApiBase):
    def __init__(self, *args, **kwargs):
        super(HttpApi, self).__init__(*args, **kwargs)

    def login(self, username, password):
        path = '/v1/api/login?username='+urllib.parse.quote(str(username), safe='')+'&password='+urllib.parse.quote(str(password), safe='')
        method = 'GET'
        self.send_request(data=None, path=path, method=method)
@lebeno
Copy link
Author

lebeno commented May 7, 2024

Pinging @jayp193 and @karthikeyan-dhandapani to please have a look at this issue and the proposed fix that URL encodes username and password in the API call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant