MLFlowClient.jl icon indicating copy to clipboard operation
MLFlowClient.jl copied to clipboard

Authenticating via REST API

Open mashu opened this issue 2 years ago • 4 comments

Hi, in the examples I see that it's possible to pass some dictionary with Authentication token, does that mean authentication is supported? if I dont have basic-auth set, the instance gets hacked. So it would be good to have.

mashu avatar Nov 10 '23 12:11 mashu

Which examples do you refer to? I would also be very interested in authentication support; unfortunately, I can't invest a lot of time right now, though …

dpaetzel avatar Nov 28 '23 15:11 dpaetzel

@dpaetzel I figured it works by just starting mlflow with authentication

mlflow server --app-name basic-auth

changing password ASAP

then logging as follow, where I use TOML file to store username and password

using Base64
using TOML
using MLFlowClient
# Create MLFlow instance
config = open("config.toml", "r") do file
    TOML.parse(read(file, String))
end
username = config["database"]["user"]
password = config["database"]["password"]
encoded_credentials = base64encode("$username:$password")
headers = Dict("Authorization" => "Basic $encoded_credentials")
mlf = MLFlow(mlflow_url, headers=headers)

mashu avatar Nov 28 '23 19:11 mashu

Awesome, thank you! :relaxed:

dpaetzel avatar Nov 29 '23 08:11 dpaetzel

@deyandyankov, could an authorization parameter be considered in the future? This can be an usability upgrade.

pebeto avatar Dec 25 '23 03:12 pebeto