I am trying to configure 3rd party authentication in a docker deployment of parse-server. After many tests, I have a working configuration of parse-server-example, modifying index.js.
export const config = {
auth: {
keycloak: {
enabled: true,
config: {
âŚ
}
}
}
};
âŚ
when I inspect the config object, I find
auth: { keycloak: { enabled: true, config: [Object] } },
which seems ok.
Iâd like to make it work with a docker container and I donât get how to pass the configuration options to parse.
I have tried with environment variables
- PARSE_SERVER_AUTH_PROVIDERS={âkeycloakâ:{âenabledâ:true,âconfigâ:{âhostnameâ:âkeycloakhostâ,ârealmâ:ârealmâ}}}
and with a config.json :
{
âŚ
âauthâ: {âkeycloakâ:{âenabledâ:true,âconfigâ:{âhostnameâ:âkeycloakhostâ,ârealmâ:ârealmâ}}}
}
When I inspect the config object in that case, I find an array instead of an object :
auth: [
â{âkeycloakâ:{âenabledâ:trueâ,
ââconfigâ:{ârealmâ:ârealmââ,
ââhostnameâ:âkeycloakhostâ}}}â
],
parse-server --help says :
âauth [auth] Configuration for your authentication providers, as stringified JSON. See Parse Server Guide | Parse
What is the correct way to configure 3rd party auth in config.json or with env vars ? What should be my stringified JSON ?
PS: I have a modified keycloak.js adapter, as the one in parse is buggy, which explains the âhostnameâ key in âconfigâ.