Generate auth token using cli/api

Hi Team,

I want to generate an auth token after installing Jupyterhub with admin user using cli or API on Ubuntu. I don’t want to use an option from UI.

Any pointers for the above would appreciated.
Thanks

1 Like

There are two choices for generating tokens:

  1. You can run jupyterhub token username to issue a token for a user on stdout, or
  2. you can generate tokens yourself (e.g. openssl rand -hex 32) and load them into jupyterhub from configuration

Depending on what you’re doing, usually we recommend associating tokens with services rather than users. In practice, a ‘service’ is often really a named token with its own permissions.