Error using Basic Authenitcaton with Web App

General Discussion

Error using Basic Authenitcaton with Web App

Postby TangoWhiskey » Sun Apr 08, 2018 6:22 am

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
TangoWhiskey
newt
newt
 
Posts: 8
Joined: Sun Apr 08, 2018 6:12 am

Re: Error using Basic Authenitcaton with Web App

Postby kevin » Sun Apr 08, 2018 8:19 am

appears to be a bug, please file an issue on github
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Error using Basic Authenitcaton with Web App

Postby TangoWhiskey » Sun Apr 08, 2018 8:29 am

Done
TangoWhiskey
newt
newt
 
Posts: 8
Joined: Sun Apr 08, 2018 6:12 am

Re: Error using Basic Authenitcaton with Web App

Postby TangoWhiskey » Tue Apr 10, 2018 2:38 pm

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?
TangoWhiskey
newt
newt
 
Posts: 8
Joined: Sun Apr 08, 2018 6:12 am

Re: Error using Basic Authenitcaton with Web App

Postby kevin » Tue Apr 10, 2018 4:03 pm

I don't understand - log in where? What is telling you that doesn't require authentication?
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Error using Basic Authenitcaton with Web App

Postby TangoWhiskey » Tue Apr 10, 2018 4:51 pm

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.
TangoWhiskey
newt
newt
 
Posts: 8
Joined: Sun Apr 08, 2018 6:12 am

Re: Error using Basic Authenitcaton with Web App

Postby kevin » Tue Apr 10, 2018 4:55 pm

Oh, no the webapp does not support logging in to itself via basic auth.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Error using Basic Authenitcaton with Web App

Postby TangoWhiskey » Wed Apr 11, 2018 3:00 am

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
TangoWhiskey
newt
newt
 
Posts: 8
Joined: Sun Apr 08, 2018 6:12 am

Re: Error using Basic Authenitcaton with Web App

Postby kevin » Wed Apr 11, 2018 4:46 am

pull down the dev branch from github or wait until it is merged to master and the updater will do it for you.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Error using Basic Authenitcaton with Web App

Postby TangoWhiskey » Sun Apr 15, 2018 2:55 pm

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.
TangoWhiskey
newt
newt
 
Posts: 8
Joined: Sun Apr 08, 2018 6:12 am

Next

Return to General

Who is online

Users browsing this forum: No registered users and 28 guests

cron