Page 1 of 2

Error using Basic Authenitcaton with Web App

PostPosted: Sun Apr 08, 2018 6:22 am
by TangoWhiskey
I am trying to send a notification to an ISY 994i. I am setting up a custom notification to use its REST API to set a variable in the ISY. The ISY requires basic authentication, but when I check this box and add a user name and password I get what looks like an uncaught exception. The first few lines of the stack trace show

TypeError
TypeError: encodestring() takes exactly 1 argument (2 given)
Traceback (most recent call last)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 128, in __call__
return self.app(environ, start_response)


This is 100% repeatable for me. I tried editing a notification and setting up a new one. I have the ISY URL in the URL, the rest command in the path, get, URL encoded, basic auth on, a user name and a password. I do not get the exception when I do not use the basic authentication. Am i doing something wrong, is this a known bug, and is there a work around?

I am running the AD2PI Network Appliance that I bought pre-configured.
Thanks

Re: Error using Basic Authenitcaton with Web App

PostPosted: Sun Apr 08, 2018 8:19 am
by kevin
appears to be a bug, please file an issue on github

Re: Error using Basic Authenitcaton with Web App

PostPosted: Sun Apr 08, 2018 8:29 am
by TangoWhiskey
Done

Re: Error using Basic Authenitcaton with Web App

PostPosted: Tue Apr 10, 2018 2:38 pm
by TangoWhiskey
Part two of this. When I try the basic authentication to automatically login from the command line (i.e. add username:password@ in the URL) I get a message that tells me

You are about to log in to the site “192.168.XXX.XXX” with the username “user”, but the website does not require authentication. This may be an attempt to trick you.

Is “192.168.XXX.XXX” the site you want to visit?


regardless of how I answer the yes/no prompt I am not logged in. Is there something I am doing or have set up wrong that it does not think it needs authentication? I have to log in to use the web app. It looks like ability this was added/fixed as issue 18. BTW, I am using the proper user name and password for a web app user, I tweaked the message above to be "user".

Also, I saw the issue for part one (issue 34) was fixed in GitHub (thanks!). How do I get the into fix to my rPi?

Re: Error using Basic Authenitcaton with Web App

PostPosted: Tue Apr 10, 2018 4:03 pm
by kevin
I don't understand - log in where? What is telling you that doesn't require authentication?

Re: Error using Basic Authenitcaton with Web App

PostPosted: Tue Apr 10, 2018 4:51 pm
by TangoWhiskey
I am trying to log into the web app itself in a new tab in a browser. So I log out, then in the address bar I put in https://username:password@192.168.XXX.XXX/login and I get the message followed by the login screen.

Re: Error using Basic Authenitcaton with Web App

PostPosted: Tue Apr 10, 2018 4:55 pm
by kevin
Oh, no the webapp does not support logging in to itself via basic auth.

Re: Error using Basic Authenitcaton with Web App

PostPosted: Wed Apr 11, 2018 3:00 am
by TangoWhiskey
I guess that is why it isn't working :-)

Is there an easy way for me to get the fix for the basic auth (issue 34) in the notifications into my installation?

Thanks for the quick responses

Re: Error using Basic Authenitcaton with Web App

PostPosted: Wed Apr 11, 2018 4:46 am
by kevin
pull down the dev branch from github or wait until it is merged to master and the updater will do it for you.

Re: Error using Basic Authenitcaton with Web App

PostPosted: Sun Apr 15, 2018 2:55 pm
by TangoWhiskey
It looks like it is one step closer to working. Now it gives a message about a non-numeric port and shows the IP address. I am guessing this is issue 18 again (https://github.com/nutechsoftware/alarm ... /issues/18) and it is taking the colon in the auth header as indicating a port.