How to run the RegisterUserExample Admin API example code in RSA Mobile Authentication Server 1.5
2 years ago
Originally Published: 2004-05-18
Article Number
000062475
Applies To
RSA Mobile 1.5 Authentication Server
Microsoft Windows 2000 Advanced Server SP4
Issue
How to run the RegisterUserExample Admin API example code in RSA Mobile Authentication Server 1.5
No information is available showing what is required to make the example Admin API program useable
Cause
Due to an oversight, this information has been missed off the issued product
Resolution
The Admin API has been designed to run on the Authorization Server or an Identity Manger in an RSA Mobile system. A working API program has three functional requirements:

1. The correct JAR files available on the CLASSPATH

2. Configuration files

3. A mandatory series of parameters passed into the application

It is not necessary for the Identity Manager to be running where the Admin API is being used; it is simply an expedient way of ensuring the correct configuration has been applied. To understand how to run the sample program, the easiest way is to follow the steps outlined below on an installed Identity Manager.

Compile the example code and copy it to <INSTALLDIR>\com\rsa\examples\RegisterUserExample.class (this will mean that it will be found on the CLASSPATH set up below)

Create a "test script" and place it in the <INSTALLDIR>\bin directory with the following lines:

------------------------------------------------
@echo off
SETLOCAL
cd ..\bea

@rem Set user-defined variables.
rem set WL_HOME=.
set BEA_HOME=.
set RSA_HOME=..
set JAVA_HOME=%BEA_HOME%\jdk131
set LIB_DIR=%RSA_HOME%\lib
set RSA_LIB=%RSA_HOME%\rsalib
set RSA_BIN=%RSA_HOME%\bin
set WEBAPP_LIB_DIR=wlserver\config\csfdomain\applications\rsaAdmin\WEB-INF\lib

:checkJDK
if exist "%JAVA_HOME%/bin/javaw.exe" goto runApp
echo.
echo Java wasn't found in directory %JAVA_HOME%/bin.
echo Please edit the runExample.cmd script so that the JAVA_HOME
echo variable points to the root directory of your JDK installation.
goto finish

:runApp
set PATH=%JAVA_HOME%\bin;%WINDIR%;%WINDIR%\SYSTEM32
set PATH=%RSA_HOME%\bin;%PATH%

set PROPERTIES_DIR=%RSA_HOME%\properties
set BUNDLE_DIR=%RSA_HOME%
for %%i in (%LIB_DIR%\*.jar) do call %RSA_BIN%\scp.cmd %%i
for %%i in (%RSA_LIB%\*.jar) do call %RSA_BIN%\scp.cmd %%i
for %%i in (%WEBAPP_LIB_DIR%\*.jar) do call %RSA_BIN%\scp.cmd %%i

set CLASSPATH=%BUNDLE_DIR%;%CD%;%CP%

set OPTIONS=-Dproperties.directory=%PROPERTIES_DIR%
set OPTIONS=%OPTIONS% -Dlog4j.configuration=file:%PROPERTIES_DIR%\webserverlogconfig.properties
set OPTIONS=%OPTIONS% -Djava.library.path=%RSA_BIN%;.

set SERVICE_TYPE=managed
call %RSA_BIN%\setserverenv.cmd

%JAVA_HOME%\bin\java -classpath "%CLASSPATH%" %OPTIONS% %RSA_OPTIONS% com.rsa.examples.RegisterUserExample %*
goto finish

:finish
ENDLOCAL
------------------------------------------------

Run the example script (from a command line in the <INSTALLDIR>\bin directory) with the required parameters (admin-user,admin-password,user), for example:

    C:\RSASecurity\rsawebserver\bin>   mytest.cmd admin passwd01 joesoap

If the installed Identity Manager is going to be used solely for the Admin API, then (a) it never need be started and (b) files may be deleted to decrease the filespace used. In this situation to reclaim disk space from Identity Manager, then do the following:

1. Copy all *.jar files from <INSTALLDIR>\rsawebserver\bea\wlserver\config\csfdomain\applications\rsaAdmin\WEB-INF\lib   to   <INSTALLDIR>\rsawebserver\rsalib

2. Remove <INSTALLDIR>\rsawebserver\bea\wlserver directory and subdirectories