How do you compile and use the Siteminder Java SDK Active Response sample?

Document ID : KB000053821
Last Modified Date : 14/02/2018
Show Technical Document Details

Description

The following describes the steps needed to properly compile and test the Siteminder Java SDK Active Response sample.

Solution

To set up and use the Siteminder SDK sample for Active Responses, do the following:

  1. Be sure you have installed the JDK, and "<installed JDK>\bin" is in your system path.

  2. Go to the "<installed SDK>\sdk\samples\javaazapi" folder.

  3. Run "java-build.bat" (this will compile the Active Expression examples into their '.class' files)

  4. Create a new directory tree as follows: "<your working folder ...>\com\netegrity\sdk\javaazapi\"

  5. Move all class files into this new subdirectory as follows: "move *.class com\netegrity\sdk\javaazapi\"

  6. While still in the "<installed SDK>\sdk\samples\javaazapi" folder, run the following command: "jar -cf ActiveResponseSample.jar com/netegrity/sdk/javaazapi/*.class"
    (Doing this will place the classes in the proper hierarchy within the jarfile.)

  7. Copy "ActiveResponseSample.jar" to the "<installed Policy Server>\bin\thirdparty\" folder.

  8. Edit the "<installed Policy Server>\config\JVMOption.txt" configuration file as follows:

    Add the newly created jarfile to the "-Djava.class.path=" parameter, e.g.:
    "-Djava.class.path=<other jarfiles, etc.>;C:\Program Files\netegrity\siteminder\bin\thirdparty\ActiveResponseSample.jar"

  9. Restart the Policy Server, so that it will pick up the modified java path

  10. To try the Active Response sample, and send results to a cookie, create your Active Response as follows:
    (NOTE: do not include the quotes)

    • Attribute: "WebAgent-HTTP-Cookie-Variable"

    • Cookie Name: "userDNtest"

    • Library Name: "smjavaapi"

    • Function Name: "JavaActiveExpression"

    • Parameters: "com.netegrity.sdk.javaazapi.ActiveResponseSample People"

Under the "Advanced" tab, you should see the following:

usertest=<@lib="smjavaapi" func="JavaActiveExpression" param="com.netegrity.sdk.javaazapi.ActiveResponseSample People"@>

When this response is added to a domain policy, an authenticated user will see a cookie returned from the server, whose name is "userDNtest", and whose value is the user's DN. In this sample function, it will only return the user's DN if the user is part of the Organization Unit named "People".