Hi, how to set a BOKEH_SECRET_KEY environment variable

I want to add some authentication so that only people logged in my website can go to the bokeh app.

I tried a command " bokeh serve xxx.py --port=5008 --allow-websocket-origin=localhost:5008 --session-ids external-signed", and got some errors.

It says,“To sign sessions, the BOKEH_SECRET_KEY environment variable must be set; the bokeh secret command can be used to generate a new key.”

Hi,

It's not clear what you are asking. You can run the following at the command line:

  bokeh secret

This will output a secret key to the console (protect it!) that you can use to sign Bokeh session ID's with (instead of just generating random ones). To use it, set the BOKEH_SECRET_KEY to this key value when you run the Bokeh server. E.g. for a bash shell, you could do:

  BOKEH_SECRET_KEY=<put key here> bokeh serve app.py

I'm not a windows user so I don't know how to set windows environment variables offhand, but it can be done similarly.

Thanks,

Bryan

···

On Sep 6, 2017, at 02:48, wei Lu <[email protected]> wrote:

I want to add some authentication so that only people logged in my website can go to the bokeh app.

I tried a command " bokeh serve xxx.py --port=5008 --allow-websocket-origin=localhost:5008 --session-ids external-signed", and got some errors.

It says,"To sign sessions, the BOKEH_SECRET_KEY environment variable must be set; the `bokeh secret` command can be used to generate a new key."

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d750b9e3-6724-4144-a5d7-51cefbacfa7c%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.