panel icon indicating copy to clipboard operation
panel copied to clipboard

Using basic-auth with custom Python code instead of JSON credentials file

Open vp-code opened this issue 6 months ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently basic authentication allows the specification of a JSON credentials file. This creates two issues: (1) the file has to contain the actual text passwords and (2) for panel apps deployed as containers, it necessitates redeployment each time the credentials file changes.

Describe the solution you'd like

A feature that supports custom Python code to authenticate end users (maybe a function that takes in a username and password and returns a boolean). This would enable app developers to authenticate against encrypted passwords in their own databases etc.

The current JSON credentials file approach would be a special case of this feature.

Describe alternatives you've considered

(1) Don't use basic-auth (2) Meticulously protect the JSON file; redeploy each time the file changes

Additional context

This feature would make basic authentication a flexible and powerful mechanism for those unwilling to get lost in the intricacies of more elaborate methods

vp-code avatar May 31 '25 00:05 vp-code

This issue has been mentioned on HoloViz Discourse. There might be relevant details there:

https://discourse.holoviz.org/t/how-to-use-basic-auth-with-custom-credentials-validation-code/8787/3

holovizbot avatar May 31 '25 00:05 holovizbot