Generating custom secrets

If you want to generate the custom secrets values you can do this right from your console using a simple command.

You can use the openssl command (commonly available on many Unix-based systems) combined with tr and head commands. Here's how you can do it for each of your requirements:

# For UI_BAKERY_JWT_SECRET
openssl rand -base64 100 | tr -dc 'A-Z0-9' | head -c 42; echo
# For UI_BAKERY_JWT_SERVICE_ACCOUNT_SECRET
openssl rand -base64 100 | tr -dc 'A-Z0-9' | head -c 55; echo
# For UI_BAKERY_JWT_REFRESH_SECRET
openssl rand -base64 100 | tr -dc 'A-Z0-9' | head -c 42; echo
# For UI_BAKERY_CREDENTIALS_SECRET
openssl rand -base64 100 | tr -dc 'A-Z0-9' | head -c 32; echo
# For UI_BAKERY_MFA_SECRET
openssl rand -base64 100 | tr -dc 'A-Z0-9' | head -c 32; echo

Alternatively, you can use urandom to generate the secrets:

# For UI_BAKERY_JWT_SECRET
echo $(LC_ALL=C tr -cd "A-Za-z0-9" < /dev/urandom | head -c 42 | xargs -0)
# For UI_BAKERY_JWT_SERVICE_ACCOUNT_SECRET
echo $(LC_ALL=C tr -cd "A-Za-z0-9" < /dev/urandom | head -c 55 | xargs -0)
# For UI_BAKERY_JWT_REFRESH_SECRET
echo $(LC_ALL=C tr -cd "A-Za-z0-9" < /dev/urandom | head -c 42 | xargs -0)
# For UI_BAKERY_CREDENTIALS_SECRET
echo $(LC_ALL=C tr -cd "A-Za-z0-9" < /dev/urandom | head -c 32 | xargs -0)
# For UI_BAKERY_MFA_SECRET
echo $(LC_ALL=C tr -cd "A-Za-z0-9" < /dev/urandom | head -c 32 | xargs -0)

Last updated

© 2024 UI Bakery