I am implementing a modified version of Duo Labs' py_webauthn demo in order to add physical authentication to my website. The demo is built in Flask, and uses the flask-login library in conjunction with an SQLAlchemy database to store user data.
What I would ideally like is for the Flask app to act as an Nginx authenticator, such that a logged-in user is able to access other proxy_pass'ed services on the server.
I had originally attempted to implement the reverse proxies in Flask, but the only working solution I have found requires the Twisted framework (as services like Shellinabox require constant requests being made), which needs a entirely separate WSGI application to be set up—an unnecessary middleman that is difficult to integrate.
My ideal result would be for a user to initially access the server and be proxy-pass'ed to the Flask authentication server, then would be able to access several other reverse-proxied services through Nginx. I am still open to a Python reverse proxy, but have found that Nginx best suits my needs.
How should I go about integrating Flask and Nginx?
(The app.py file for the demo library is available here. The Webauthn functionality is simply built on top of flask-login.)

所有评论(0)