Using environment variables for OpenID Connect URL and secret

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.18

Describe the issue:
I need to use environment variables for the security settings related to OpenID Connect authentication (URL, client id and secret) in a docker compose file.

I’ve tried different combinations but the only one that works is to provide the literal value in the opensearch_dashboards.yml file.

I tried adding environmetns section in the docker compose file:

  opensearch-dashboards:
    image: opensearchproject/opensearch-dashboards:2.18.0
    environment:
      ..
      # using variable from .env file:
      OPENSEARCH_SECURITY_OPENID_CONNECT_URL: "${OPENSEARCH_OPENID_CONNECT_URL}"

      # using lower case variable:
      opensearch_security.openid.connect_url: '${OPENSEARCH_SECURITY_OPENID_CONNECT_URL}'

The opensearch_dashboards.yml file also is not taking variables. I tried:

opensearch_security.openid.connect_url: "${OPENSEARCH_OPENID_CONNECT_URL}"

I also tried using literal values but none are taken. The error always says:

2024-12-18T23:21:11.658631690Z {“type”:“log”,“@timestamp”:“2024-12-18T23:21:11Z”,“tags”:[“fatal”,“root”],“pid”:1,“message”:"Error: Failed when trying to obtain the endpoints from your IdP\n at OpenIdAuthentication.init (/usr/share/opensearch-dashboards/plugins/securityDashboards/server/auth/types/openid/openid_auth.ts:126:13)\n at MultipleAuthentication.init

The only thing that works is using literal values in opensearch_dashboards.yml file. Is there no way to use environment variables for these settings?

@dmossakowski According to my tests, OpenSearch Dashboards will ignore environmental settings for security plugin. It must be placed directly in the opensearch_dashboards.yml file.