auth0-deploy-cli icon indicating copy to clipboard operation
auth0-deploy-cli copied to clipboard

Include database connection configuration value samples

Open nicosabena opened this issue 5 years ago • 2 comments

I'd be nice to document and include options.configuration in a custom DB connection script example, to show how to provide configuration values (secrets), and clarify in the docs that these values aren't exported.

nicosabena avatar Jan 21 '20 21:01 nicosabena

I would like to know the YAML syntax to set custom database settings. I can't seem to find any examples or documentation on this, and they aren't exported with a placeholder like the other config settings seem to be so there's no pattern to follow.

lorenh avatar Apr 02 '20 03:04 lorenh

For the directory (json) format, the database.json file for each custom DB would look like this sample:

{
  "id": "con_FDx22jJKk6XkAoWK",
  "options": {
    "mfa": {
      "active": true,
      "return_enroll_settings": true
    },
    "passwordPolicy": "low",
    "disable_signup": false,
    "requires_username": false,
    "strategy_version": 2,
    "brute_force_protection": true,
    "enabledDatabaseCustomization": true,
    "configuration": {
      "my_secret_key_1":"my-secret-value-1",
      "my_secret_key_2":"my-secret-value-2"
    },
    "import_mode": false,
    "password_no_personal_info": {
      "enable": false
    },
    "password_dictionary": {
      "enable": false,
      "dictionary": []
    },
    "password_history": {
      "enable": false,
      "size": 5
    },
    "password_complexity_options": {
      "min_length": 6
    },
    "customScripts": {
      "login": "./login.js",
      "change_password": "./change_password.js",
      "get_user": "./get_user.js"
    }
  },
  "strategy": "auth0",
  "name": "custom-db",
  "is_domain_connection": false,
  "realms": [
    "custom-db"
  ],
  "enabled_clients": [  ]
}

For YAML, the tenant.yaml file would have something like this in the custom DBs section:

databases:
  - name: custom-db
    strategy: auth0
    id: con_FDx22jJKk6XkAoWK
    enabled_clients:
    is_domain_connection: false
    options:
      mfa:
        active: true
        return_enroll_settings: true
      import_mode: false
      customScripts:
        change_password: ./databases/custom-db/change_password.js
        create: ./databases/custom-db/create.js
        delete: ./databases/custom-db/delete.js
        get_user: ./databases/custom-db/get_user.js
        login: ./databases/custom-db/login.js
        verify: ./databases/custom-db/verify.js
      disable_signup: false
      passwordPolicy: low
      password_history:
        size: 5
        enable: false
      strategy_version: 2
      requires_username: false
      password_dictionary:
        enable: false
        dictionary: []
      brute_force_protection: true
      password_no_personal_info:
        enable: false
      password_complexity_options:
        min_length: 6
      enabledDatabaseCustomization: true
      configuration:
        my_secret_key_1: my-secret-value-1
        my_secret_key_2: my-secret-value-2
    realms:
      - custom-db

nicosabena avatar Oct 30 '20 15:10 nicosabena

Apologies for the delay in getting to this! We finally have this available within https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md

As such we'll be closing this down now.

sergiught avatar Oct 27 '22 16:10 sergiught