Basic Authentication when running a Panel server programmatically

I’d like to use the basic auth feature of Panel. It worked when running as

panel serve app.py --basic-auth my_password --cookie-secret my_super_safe_cookie_secret

as shown in the document. But is there a way to use it when running programmatically using pn.serve()? I tried to provide basic_auth="my_password" and cookie_secret="my_super_safe_cookie_secret" to pn.serve(), but they don’t work. I also used PANEL_BASIC_AUTH and PANEL_COOKIE_SECRET, but failed.

(the link to the image in the auth page was not found)

Added: I’m using Panel 1.0.2.

1 Like

I’m not sure it’s handled properly when serving programmatically. Mind filing an issue with Panel?

I’ll do it.

2 Likes

It looks to be fixed in Panel 1.0.3.