SecretProviderGet() in Lucee 7.0.0.395

I am unable to get this to work. In my .CFconfig.json file I entered (at the bottom) before the last }:

"secretProviders":{
    "json": {
       "class": "lucee.runtime.security.FileSecretProvider",
       "custom": {
          "type": "json",
          "file": "/home/example/domains/dev.example.com/keyData/systemEnv.json",
          "caseSensitive": true
          }
       }
    }

And I made sure the file exists, it’s owner is the lucee user. The permissions are 640, and this is what is inside (cleaned) which was saved to a file using serializeJSON():

{"appSalt":"xxxxx","appDevelopmentHmacKey":"xxxxxxx","appKeyRingPath":"/home/example/domains/dev.example.com/keyrings/","appKeyRingFilename":"xxxxxxxx","appPassword":"xxxxxxxx"}

And I can read it back with FileRead and deserializeJSON it back to a structure.

inside Application.cfc, in the OnApplicationStart I have:

application.password = toBinary( SecretProviderGet("appPassword") );

And Lucee responds with:

 no secret provider found that provides the key [appPassword]

Not sure where I am messing up as I think I followed all the instructions in the docs.

1 Like

ok, there’s an inconsistency, lucee is looking for secretProvider not secretProviders in the config…

I’ll clean that up, in the meantime, that’s the fix

https://luceeserver.atlassian.net/browse/LDEV-5517?focusedCommentId=71690

1 Like

Thanks!

That was indeed the problem.

1 Like