How to compile and run the SDK Agent sample?
Download the SDK package (1).
As per best practices, use the same version as the Policy Server version.
Compile and Run Sample SDK Agent 12.8SP5 on Redhat 8
====================================================
CA Access Gateway (SPS) 12.8SP5 is installed on the same machine.
CAPKIHOME environment variable relies on it.
----------------------------------------------------
# ./ca-sdk-12.8-sp05-linux-x86-64.bin -i console
===============================================================================
Choose Install Folder
---------------------
Please choose the SDK install folder.
SDK install folder: (Default: /opt/CA/sdk): /opt/CA/sdk
===============================================================================
Pre-Installation Summary
------------------------
Please Review the Following Before Continuing:
Product Name:
SiteMinder SDK
Install Folder:
/opt/CA/sdk
Disk Space Information (for Installation Target):
Required: 457,312,180 Bytes
Available: 84,070,400 Bytes
PRESS <ENTER> TO CONTINUE:
===============================================================================
Installation Complete
---------------------
Congratulations. SiteMinder SDK has been successfully installed to:
/opt/CA/sdk
# export PATH=${PATH}:/opt/jdk8u275-b01/bin
# export CAPKIHOME=/{home_sps}/agentframework/CAPKI
# cd /opt/CA/sdk/samples/smjavaagentapi
# nano -w java-build.sh
replace
javac -classpath ../../properties:../../java/smjavaagentapi.jar:../../java/smjavasdk2.jar JavaTestClient.java
with :
javac -classpath ../../properties:../../java/smagentapi.jar:../../java/smcrypto.jar:../../java/bc-fips-1.0.1.jar JavaTestClient.java
# ./java-build.sh
# nano -w java-run.sh
replace :
java $JVMMODE -Dcom.ca.siteminder.sdk.agentapi.enableDebug=true -Djava.library.path=../../bin -classpath .:../../properties:../../java/smjavasdk2.jar:../../java/smjavaagentapi.jar JavaTestClient
with :
java $JVMMODE -Djava.library.path=../../bin -classpath .:../../properties:../../java/smagentapi.jar:../../java/smcrypto.jar:../../java/bc-fips-1.0.1.jar JavaTestClient
# nano -w /opt/CA/sdk/properties/smjsdksample.properties
PS_IP = 192.168.1.101
AGENT_NAME = jsdksample-agent
AGENT_SECRET = <password>
AGENT_IP = 192.168.1.108
USER_NAME = <user>
USER_PWD = <password>
CHALLENGE_USER_NAME = <user>
CHALLENGE_USER_PWD = <password>
LOGGING_DETAIL = true
LOGFILE_NAME = /opt/CA/sdk/samples/smjavaagentapi/smjsdksample.log
In AdminUI create a domain to protect : /resfilter/private.html
with Basic authentication scheme
.
# ./java-run.sh
Welcome to the Interactive FTP Server
-------------------------------------
Do you want to connect through:
(1) 4.x Agent Interface
(2) 5.x Agent Interface(smreghost utility must be run before it)
-------------------------------------
Enter the Agent type(1/2) to connect:
1
>>>>>>>>>>>>> SiteMinder Java Agent API Sample <<<<<<<<<<<<<
++ Initialization ++
Policy Server IP Address.................: 192.168.1.101
Agent IP Address.........................: 192.168.1.108
Agent Name...............................: jsdksample-agent
Agent Shared Secret......................: <password>
______________________________________________________________
++ SetAgentInstanceInfo ++
DoManagement (SET_AGENT_INSTANCE_INFO)...: 1 (YES)
______________________________________________________________
++ DoManagement ++
DoManagement (GET_AGENT_COMMANDS)........: 1 (YES)
______________________________________________________________
++ IsProtected ++
Resource Name............................: /resfilter/private.html
Action...................................: GET
IsProtected..............................: 1 (Resource is Protected)
Realm Name...............................: jsdksample-agent
Realm OID................................: 06-0009f4d5-47d7-1143-8386-0165c0a80000
______________________________________________________________
++ Authentication ++
Login....................................: 1 (YES)
Session ID...............................: Ur [...omitted for brevity...] KI=
Session Spec.............................: ze [...omitted for brevity...]Xw=
Attributes...............................: 167
218 cn=<user>,dc=example,dc=com
152 <user>
151 0e-00061ba9-ec1a-1006-8bb0-0165c0a80000
213 <user>
214 192.168.1.101:389
215 LDAP:
______________________________________________________________
++ Authorization ++
Authorized...............................: 1 (YES)
Session ID...............................: Ur [...omitted for brevity...] KI=
Session Spec.............................: 20k [...omitted for brevity...] Lk=
Attributes...............................: 167
218 cn=<user>,dc=example,dc=com
152 <user>
151 0e-00061ba9-ec1a-1006-8bb0-0165c0a80000
213 <user>
214 192.168.1.101:389
215 LDAP:
Attributes after update..................: 146
147
______________________________________________________________
++ SSO Token ++
Create SSO Token.........................: 0 (SUCCESS)
Session Token............................: Ig [...omitted for brevity...] KUt
Decode SSO Token.........................: 0 (SUCCESS)
Token Version............................: 401
Thirdparty Token.........................: true
Attributes from Token....................: 200 jsdksample-agent
218 cn=<user>,dc=example,dc=com
209 20k [...omitted for brevity...] 8Lk=
205 Ur [...omitted for brevity...] KI=
210 <user>
208 192.168.1.108
225 3600
226 7200
154 1631801022
155 1631801022
228 SM
Update SSO Token.........................: 0 (SUCCESS)
Attributes from Token....................: 200 jsdksample-agent
218 cn=<user>,dc=example,dc=com
209 20k [...omitted for brevity...] Lk=
205 Ur [...omitted for brevity...] KI=
210 <user>
208 192.168.1.108
225 3600
226 7200
154 1631801022
155 1631801022
228 SM
______________________________________________________________
++ Cleanup ++
Logout...................................: 1 (YES)
UnInit...................................: 0 (SUCCESS)
>>>>>>>>>>>>>>>>>>>>>>>>>>>> End <<<<<<<<<<<<<<<<<<<<<<<<<<<