Environment Variable in ldap.properties

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Environment Variable in ldap.properties

Noriyuki TAKEI
Hi,All

I,d like to use Environment Variable in ldap.properties.

For example,if I defined ldap.properties as below
and define the environment value as LDAP_HOST=192.168.0.1 ,
it would be nice that ${LDAP_HOST} will be replaced to 192.168.0.1.

idp.authn.LDAP.ldapURL                          = ldap://${LDAP_HOST}:389

Could you tell me how to solve this?

--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Environment Variable in ldap.properties

Noriyuki TAKEI
Hi,all

I solved this by defining ldap.properties as below.

idp.authn.LDAP.ldapURL                          = ldap://${LDAP_HOST:localhost}:389

On Thu, Dec 12, 2019 at 5:29 PM Noriyuki TAKEI <[hidden email]> wrote:
Hi,All

I,d like to use Environment Variable in ldap.properties.

For example,if I defined ldap.properties as below
and define the environment value as LDAP_HOST=192.168.0.1 ,
it would be nice that ${LDAP_HOST} will be replaced to 192.168.0.1.

idp.authn.LDAP.ldapURL                          = ldap://${LDAP_HOST}:389

Could you tell me how to solve this?


--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Environment Variable in ldap.properties

Peter Schober
* Noriyuki TAKEI <[hidden email]> [2019-12-12 10:04]:
> I solved this by defining ldap.properties as below.
>
> idp.authn.LDAP.ldapURL = ldap://${LDAP_HOST:localhost}:389

And that also works if LDAP_HOST is defined with a value other than
"localhost"?

Just asking since the answers to this SO question claim that Java
itself does not support this (though Apache commons configuration
seems to when using the "env:" prefix on the variable name, which
doesn't match your example either):
https://stackoverflow.com/questions/2263929/regarding-application-properties-file-and-environment-variable

But maybe Shibboleth's own code does this, I haven't checked.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]