Skip to content
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

custom htpasswd file for specific tenant passed as argument's endpoint #129

Open
kovacivo opened this issue Jun 18, 2021 · 1 comment
Open
Labels

Comments

@kovacivo
Copy link

Hello Miguel,

I have a use case where for some REST endpoints I want to use the HTTP Basic Auth but let authentication run against custom htpasswd file. For example, for endpoint http://localhost:5000/api/someAPIcall I want to pass specific tenant and authentication will run against his/her htpasswd file - look up via file system in specific directory. My goal is to separate different tenants (customers) and not to use just one big common htpasswd file for all of them.

Unfortunately, I am not that deep into Python and Flask, tough digging currently on everyday basis. Looking at the functions and wondering how to do that.

@miguelgrinberg
Copy link
Owner

This extension does not provide any authentication logic, it just facilitates the use of an authentication method such as Basic Auth. What you can do is start from the basic auth example and replace the logic in the verify_password() to allow/deny access using your htpasswd files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants