Have client SDK use other than AMConfig.properties?

Tagged: 

This topic has 3 replies, 2 voices, and was last updated 5 years, 2 months ago by Peter Major.

  • Author
    Posts
  • #18222
     stevenswj
    Participant

    There are two different AMConfig.properties files my OpenAM client program (runs on Tomcat 7) needs to be able to run. One connects to an integration OpenAM, the other a production. But it appears the Java SDK does not allow for specifying a different properties filename other than just AMConfig.properties? Is this hardcoded? Cannot be changed? If this is true then it looks like I will need to create two different web deployment copies for the same program that uses the SDK instead of the same deployment that uses different properties files (based on which OpenAM the user wishes to connect)? Any way around this? Thanks!

    • This topic was modified 5 years, 2 months ago by stevenswj.
    • This topic was modified 5 years, 2 months ago by stevenswj.
    #18237
     Peter Major
    Moderator

    The ClientSDK only supports one environment at a time. Trying to connect a single SDK to several OpenAM deployments will result in pain:
    https://bugster.forgerock.org/jira/browse/OPENAM-1452

    Best way around this limitation is to use the REST APIs instead.

    #18245
     stevenswj
    Participant

    This tool actually only uses one environment at a time. I would just like it to be able to choose which config file it uses. Is it possible to switch configs and maybe do a reload?

    • This reply was modified 5 years, 2 months ago by stevenswj.
    #18253
     Peter Major
    Moderator

    The SystemProperties class is responsible of loading the right config file, you can also manually initialize it and not have any properties file on classpath. Having said this, I just want to reiterate: the clientsdk cannot be used against more than one environment during a lifetime of a JVM. Once the ClientSDK has been initialized to use one OpenAM deployment, changing the settings to point at a different OpenAM deployment will result in undefined behavior.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?