Open xapple opened 6 years ago
@xapple, I'm running into the same issue. Locally it works out perfectly but deploying on a Webfaction server causes a bunch of invalid GET requests due to bad routing. Were you able to get around this?
No I did not find a way around it (spent about two hours on it), and abandoned dash as a viable stack for making web applications.
It is a shame... I agree dash for now it is not a viable stack for web applications. After spending a lot of time developing a dashboard, I have failed making it secure....I should have checked that part first.
Is there any workaround for this issue? It would be great to get a flask-login based authentication. I need this in order to host it on our local intranet.
Also, I understand as per dash.plot.ly/authentication
You can have BasicAuth and Plotly OAuth (I don't need this as of now as I am using this dashboard as a test project for our university student research team also no funds too :stuck_out_tongue: )
Is there a way that you can use BasicAuth to provide access through another webpage?
I can create a flask login webpage using the underlying flask server i.e
server = Flask(__name__)
Then collect the passwords from that webpage and then pass it to BasicAuth to grant basic access?
Can this be done?
Plotly OAuth is a paying service (paid Plotly subscription). I tried HTTP Basic Auth too and it didn't work either. After a few call backs the server would answer 403 consistently.
My attempt at adding flask-login to dash apps can be found here:
https://gist.github.com/xapple/bb8fe6a2adca9cbf86675cb48b59f0be
But that would give me redirect problems.
Hi Everyone! I hope to get back to this whole project soon, and this will be one of the first issues I work on. I believe it has something to the NEXT parameter in the HTTP Get requests. I'll post back here when I find a fix.
I can't validate my login... I'm getting erro like this:
Exception happened during processing of request from ('127.0.0.1', 53153) Traceback (most recent call last): File "C:\Python27\Lib\SocketServer.py", line 596, in process_request_thread self.finish_request(request, client_address) File "C:\Python27\Lib\SocketServer.py", line 331, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Python27\Lib\SocketServer.py", line 654, in init self.finish() File "C:\Python27\Lib\SocketServer.py", line 713, in finish self.wfile.close() File "C:\Python27\Lib\socket.py", line 283, in close self.flush() File "C:\Python27\Lib\socket.py", line 307, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 10053]
@thiagog3 Are you able to post your code?
@gaw89 I'm just using your "usage_dash_flask_login.py" with a time.sleep(2) in line 103. It's only a simple test to simulate my issue. This exception is triggered when I try login.
Just curious if there was a fix for this problem. have the same issue trying to deploy on pythonanywhere. thanks.
fyi - i ended up solving this problem by exposing the dash flask view and manually requiring a login there. not sure if this will help others but it was what i needed for my situation. found the solution here: https://stackoverflow.com/questions/52286507/how-to-merge-flask-login-with-a-dash-application
When using this library locally, everything works fine, but I have noticed that when deployed to heroku it messes with the callback path. Instead of GET going to
_dash-dependencies
, they go tologin?next=%2F_dash-dependencies
after login.Same for the layout calls. Here is an example from the logs: