000024412 - How do I build and run the Authentication Manager 7.0 Java examples?

Document created by RSA Customer Support Employee on Jun 16, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000024412
Applies ToAuthentication Manager 7.0
IssueHow do I build and run the Authentication Manager 7.0 Java examples?
Resolution

Included is a sample build script for Windows.  The comments in the script will walk you through the build process, just modify it where indicated.  Please note this is only an example of how to do the build, the script itself is not supported by RSA Security.

:: Example script for using the Java admin API.
:: December 2007
::
:: These commands can be used directly via the command line.  Although written for windows this can be converted to Unix, just consult the man page for the particular shell you are using.
::
:: You will need to a directory structure that matches the example.  To run the CreateUser.java example found in "C:\Program Files\RSA Security\RSA Authentication Manager\sdk\samples\admin\src\com\rsa\samples\admin", open the file and look at the first line that reads package com.rsa.samples.admin;.  You need to build from the directory above this path. (in this case the src directory)  You could also make a similar directory structure on your own as long as the path is the same as that in the package and your source files are located in admin.  For this example use your build script or run the commands from "C:\Program Files\RSA Security\RSA Authentication Manager\sdk\samples\admin\src".
::
::  Copy the config.properties file from "C:\Program Files\RSA Security\RSA Authentication Manager\sdk\samples\admin" to "C:\Program Files\RSA Security\RSA Authentication Manager\sdk\samples\admin\src" and change the process-level (command client) authentication credentials to match your install.  To get the credentials go to a cmd line and change directory to "C:\Program Files\RSA Security\RSA Authentication Manager\utils", then run "rsautil manage-secrets -a list".  In the list that is returned grab the Command API Client user and passwords.  They should look like this:
::
:: Command API Client User ID .....................: CmdClient_4mwga8gq
:: Command API Client User Password ...............: uy8CGOeqTD
::
:: Edit the config.properties file to include the information returned.  For example:
::
::# JNDI factory class.
::java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
::# Server URL(s).  May be a comma separated list of URLs if running against a cluster
::# NOTE: Replace localhost with the hostname of the managed server
::java.naming.provider.url=t3s://bburdzel-vmbox1.na.rsa.net:7002
::# User ID for process-level authentication.
::java.naming.security.principal=CmdClient_4mwga8gq
::# Password for process-level authentication
::java.naming.security.credentials=uy8CGOeqTD
::
::At this point you should have put your edited config.properties file in the src directory as noted above.  Now you will either start typing the commands below in interactive mode or put your build script in the same location.
::
::
::
:: Example build script from this point on.
::
:: Disable echoing of commands
::
@echo off
::
:: set the AM_HOME to the root Authentication Manager directory.  Change this to match the your actual install directory.
::
set AM_HOME="C:\Program Files\RSA Security\RSA Authentication Manager"
echo Setting AM_HOME
::
::
:: Setting AM_JDK to the location of the java executables.  This will make referencing them easier later.
::
set AM_JDK=%AM_HOME%\jdk\bin
echo Setting AM_JDK
::
::
:: Setting the base directory for all of the AM required class files.  If you have custom Class files then define your own LIB and include it in the AM_CLASSPATH set below.
::
set AM_LIB=%AM_HOME%\sdk\lib\java
echo Setting AM_LIB
::
::
:: Set the AM_CLASSPATH to include the AM_LIB directory and the AM jar files needed. (all of them in the AM_LIB directory)  Since we have included the base AM_LIB directory you can drop your class files directly here or you can define your own LIB and include it in the line below.
:: set AM_CLASSPATH=%AM_LIB%;%AM_LIB%\am-client.jar;%AM_LIB%\commons-lang-2.1.jar;%AM_LIB%\ims-client.jar;%AM_LIB%\wlclient-9.1.jar;%AM_LIB%;.
echo Setting AM_CLASSPATH
::
::
:: Set TRUSTSTORE to the server keystore.  This is used to create an SSL connection bewteen the command client and server.  To find the name of your truststore go to the directory below and look for a file with your machine_name.jks.  Modify the name below to match yours.
:: 
set TRUSTSTORE=%AM_HOME%\server\security\bburdzel-vmbox1.jks
echo Setting TRUSTSTORE
::
::
:: Display building message prior to the build since there is a slight delay while the command runs.
echo Building...
%AM_JDK%\javac -classpath %AM_CLASSPATH% com\rsa\samples\admin\*.java
::
:: Running the example.  Note the username and password at the end of the line.  The config.properties file contains the command client authentication information, the user below is your Authentication Manager administrator. (the user that will actually create the user)
::
echo Running...
%AM_JDK%\java -classpath %AM_CLASSPATH% -Djavax.net.ssl.trustStore=%TRUSTSTORE% com.rsa.samples.admin.CreateUser admin Attitash1!
::
:: echo a blank line
::
echo.
::
echo completed.

Legacy Article IDa38070

Attachments

    Outcomes