User Auth feature
I have seen they are auth.py file and auth settings in settings.yaml file, I'm assuming the auth feature is enabled in this project. Is there any guidance/documentation I can refer to to achieve it?
setting.yaml
server:
env_name: ${APP_ENV:prod}
port: ${PORT:8001}
cors:
enabled: false
allow_origins: ["*"]
allow_methods: ["*"]
allow_headers: ["*"]
auth:
enabled: true
# python -c 'import base64; print("Basic " + base64.b64encode("secret:key".encode()).decode())'
# 'secret' is the username and 'key' is the password for basic auth by default
# If the auth is enabled, this value must be set in the "Authorization" header of the request.
secret: "Basic c2VjcmV0OmtleQ=="
Same question here
Any one knew how this works, I have spent hours to work on this, still couldn't figure out how to have a simple password on the UI.
I will try to explain how it works by default.
Once you enable auth.enable=True, the system validates if a basic authentication is included. By default the Authorization header is: Authorization: Basic c2VjcmV0OmtleQ==. I attach an example using cURL:
curl http://localhost:8001/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Basic c2VjcmV0OmtleQ=="
-d '{
"messages": [
{
"role": "system",
"content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."
},
{
"role": "user",
"content": "Compose a poem that explains the concept of recursion in programming."
}
]
}'
Hi Jaluma
Thanks for the reply, however we want to have the authentication on the web interface, when a user typed: http://localhost:8081/ a authentication will pop up.
Thanks
Did you find a solution meanwhile? Facing the same problem...
I reopened the issue and convert it to improvement. Currently, we consider gradio as testing ui, not the final one. Please consider use other alternatives or define a custom version yourself. In documentation, we have a react application without this issue: https://docs.privategpt.dev/manual/user-interface/alternatives