Using a0deploy to set prompts

Will Vedder implemented some requested functionality in the a0deploy cli tool which allows you to manage prompts (this issue, this PR). This was really appreciated, however I’m having trouble when I try to integrate the prompts functionality to our existing setup (we already use a0deploy to manage resource servers, clients, grants, etc). I’ve added a file prompts/prompts.json to our config, and it looks a little like the below:

{
    "universal_login_experience": "new",
    "identifier_first": true,
    "webauthn_platform_first_factor": false,
    "customText": {
        "en": {
            "login": {
                "login": {
                    "pageTitle":"TEST",
                }
            }
        }
    }
}

But we run a0deploy (a0deploy import -c config-dev.json -i . in my case) everything but the prompts get set. There are some messages printed by a0deploy (included below, I actually ran this with --debug) which suggest that it considers the prompts settings … but the prompt settings aren’t actually updated.

...
info: Updated [guardianFactorTemplates]: {"name":"sms"}
info: Updated [prompts]: Prompts settings and prompts custom text
debug: Start processChanges for databases [delete:0] [update:2], [create:0], [conflicts:0]
debug: Stripping "" read-only fields ["strategy","name","id"]
debug: Stripping "" read-only fields ["strategy","name","id"]
info: Updated [databases]: {"name":"****","id":"****"}
...

I’m using a0deploy version 7.14.1 of the a0deploy tool. Is there something else I should have done? Maybe a setting in our tenant.json file? Or is my prompts/prompts.json file named or structured incorrectly?

Hello Sean,

You will need to split your file into two files: prompts.json and custom-text.json

prompts/prompts.json

{
  "universal_login_experience": "new",
  "identifier_first": true,
  "webauthn_platform_first_factor": false
}

prompts/custom-text.json

{
  "en": {
    "login": {
        "login": {
            "pageTitle":"TEST"
        }
    }
  }
}

Please test and let me know if that works.

1 Like

Hey Art,

Thanks for getting back to me both here and on the GitHub issue (I was about to add a note there that I’ve raised this issue). It looks like this worked :slight_smile:

Thanks once more!
Sean

1 Like