Performing healthcheck against individual policy servers if they are functional
search cancel

Performing healthcheck against individual policy servers if they are functional

book

Article ID: 368032

calendar_today

Updated On:

Products

SITEMINDER CA Single Sign-On

Issue/Introduction

This is to provide general idea how to do a health check against individual policy servers if they are functional.

Resolution

There can be many ways to determine if Policy Server is running but whether it is functional is a different topic.

One simple way is to use SiteMinder SDK bundled "{SDK}\samples\smjavaagentapi"

"{SDK}\properties\smjsdksample.properties" file must be updated accordingly so the transaction would be successful and the necessary userstore/domain/realm/rule/policy must be configured.

Create:

jsdksample-agent (4.x agent)
jsdksample-userdir (User Directory which has a sample user named "healthcheck")
jsdksample-domain (Domain to associate above user directory)
jsdksample-realm (Resource Filter = /resfilter/)
jsdksample-rule (rule for Resource=* and for action GET and POST)

jsdksample-policy (Policy to bind the jsdksample-rule and the healthcheck user)

Compile and run the script.

java-build.bat
java-run.bat

In the selection menu, enter "1" for 4.x agent type.

Then you will see the request is sent to that specific policy server defined in the "{SDK}\properties\smjsdksample.properties"

You will see all "IsProtected", "IsAuthenticated" and "IsAuthorized" calls.

 

Sample output:

c:\SDK\samples\smjavaagentapi>java -Djava.library.path=..\..\bin -classpath .;..\..\properties;..\..\java\smjavasdk2.jar;..\..\java\smjavaagentapi.jar JavaTestClient

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.................:      127.0.0.1
Agent IP Address.........................:      127.0.0.1
Agent Name...............................:      jsdksample-agent
Agent Shared Secret......................:      secret
______________________________________________________________


++ 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-realm
Realm OID................................:      06-e78406e4-3d85-4cfd-b864-17a449b1da7b
______________________________________________________________


++ Authentication ++

Login....................................:      1 (YES)
Session ID...............................:      {SessionID}
Session Spec.............................:      {SessionServerSpec}
Attributes...............................:      167     ÿÿÿÿ
                                        218     uid=healthcheck,ou=HealthCheck,o=Example
                                        152     healthcheck
                                        151     0e-56cf2811-f315-44a9-a85a-ce9dfb48a2ad
                                        213     jsdksample-userdir
                                        214     jsdksample-host
                                        215     LDAP:
______________________________________________________________


++ Authorization ++

Authorized...............................:      1 (YES)
Session ID...............................:      {SessionID}
Session Spec.............................:      {SessionServerSpec}
Attributes...............................:      167     ÿÿÿÿ
                                        218     uid=healthcheck,ou=HealthCheck,o=Example
                                        152     healthcheck
                                        151     0e-56cf2811-f315-44a9-a85a-ce9dfb48a2ad
                                        213     jsdksample-userdir
                                        214     jsdksample-host
                                        215     LDAP:
Attributes after update..................:      146
                                        147
______________________________________________________________


++ SSO Token ++

Create SSO Token.........................:      0 (SUCCESS)
Session Token............................:      {SessionServerSpec}
Decode SSO Token.........................:      0 (SUCCESS)
Token Version............................:      401
Thirdparty Token.........................:      true
Attributes from Token....................:      200     jsdksample-agent
                                        218     uid=healthcheck,ou=HealthCheck,o=Example
                                        209     {SessionServerSpec}
                                        205     {SessionID}
                                        210     healthcheck
                                        208     127.0.0.1
                                        225     3600
                                        226     5400
                                        154     1716165170
                                        155     1716165170
                                        228     SM

Update SSO Token.........................:      0 (SUCCESS)
Attributes from Token....................:      200     jsdksample-agent
                                        218     uid=healthcheck,ou=HealthCheck,o=Example
                                        209     {SessionServerSpec}
                                        205     {SessionID}
                                        210     healthcheck
                                        208     127.0.0.1
                                        225     3600
                                        226     5400
                                        154     1716165170
                                        155     1716165170
                                        228     SM
______________________________________________________________


++ Cleanup ++

Logout...................................:      1 (YES)
UnInit...................................:      0 (SUCCESS)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>  End  <<<<<<<<<<<<<<<<<<<<<<<<<<<