-
Notifications
You must be signed in to change notification settings - Fork 36
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
support for multiple boxes and username authentication #10
base: fritzos6.5
Are you sure you want to change the base?
Conversation
@@ -25,7 +25,7 @@ | |||
USER_AGENT = "Mozilla/5.0 (U; Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0" | |||
|
|||
|
|||
def get_sid(server, password, port=80): | |||
def get_sid(server, username, password, port=80): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set default username to None:
def get_sid(server, username=None, password, port=80):
fritzbox_helper.py
Outdated
@@ -58,7 +58,7 @@ def get_sid(server, password, port=80): | |||
"Content-Type": "application/x-www-form-urlencoded", | |||
"User-Agent": USER_AGENT} | |||
|
|||
login_page = "/login_sid.lua?&response=" + response_bf | |||
login_page = "/login_sid.lua?username=" + username + "&response=" + response_bf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If username is not None, use it here, otherwise use the old url
Hi Christoph, thank you for your PR. I think it looks good. One minor thing, though. You mentioned the authentication with username/password might break the password-only option. How about this: check if there is a a username set with I added some comments in the code as well. |
Thank you for your suggestions. btw: The API request worked with the username-URL even when authentication was configured for password-only. As someone who never used python before, I am pretty proud of myself. 😄 |
Any reason that this has not been merged? I'd also like to monitor multiple boxes instead of just one |
…ig_in_plugins Add missing user from configuration for plugins
This PR is supposed to fix the following issues:
(was already fixed in this branch)
At least I had that issue. 😕
I am not sure if this breaks support for authentication without username!
Tested with FRITZ!OS 6.51 and 6.80