How to setup the SSO Java API and compile custom code using the NetBeans IDE?

book

Article ID: 52731

calendar_today

Updated On:

Products

CA Single Sign-On

Issue/Introduction

Description:

This document is describing how to setup the SSO Java API and compile some provided test code.

Demonstrating this exercise using the well known, easy to use and free IDE NetBeans.

It is out of this document's scope to provide any overview of the SSO Java API's functionality.

In order to learn details about the SSO SDK, please review its relevant documentation.

Also the attached code comes without any warranty of any kind and is not supported in any way by CA.

Solution:

  1. Download and install the Java SE Development Kit

    You must have a copy of the JRE (Java Runtime Environment) installed on your system to run Java applications and applets. To develop Java applications and applets, you need the JDK (Java Development Kit), which includes the JRE.

    To find the actual download go to
    http://java.sun.com/javase/downloads
    (You may need to enable Java Script on your browser to allow the download to happen. For IE by default it is sufficient to add the string *.sun.com to the list of Trusted Sites)

    Select "Download JDK"

    Follow the Download and Installer prompts and accept the defaults (if suitable).

  2. Download and install the NetBeans IDE

    To find the actual download go to
    http://netbeans.org/downloads
    (You may need to enable Java Script on your browser to allow the download to happen. For IE by default it is sufficient to add the string *.netbeans.org to the list of Trusted Sites)

    For this exercise it is sufficient to download the "Java SE" version of the IDE.

    Follow the Download and Installer prompts and accept the defaults (if suitable).

  3. Install the SSO INTEGRATION KIT

    Download the latest version of the SSO INTEGRATION KIT from https://support.ca.com.

    Run the setup and install the Java API from this Kit.

  4. Startup the NetBeans IDE and Register the SSO Java SDK with the IDE

    In the Tools menu select "Libraries" / "New Library" / Library Name: "SSO_Java_SDK".

    In the Library Classpath select "Add JAR/Folder" and point to the install location of the SSO SDK
    (default: C:\Program Files\CA\Single Sign-On\SDK\JAVA API\eWebACAPI.jar)

    In the Library Javadoc select "Add ZIP/Folder" and point to the SSO SDK's doc folder
    (default: C:\Program Files\CA\Single Sign-On\SDK\JAVA API\Doc)

    Confirm all, finally closing the various dialogs.

  5. Create the Java Application

    From the menu select
    File / New Project and create a new "Java Application"

    For the project name enter "SSO_JavaTestApplication" and ensure that "Create Main Class" and "Set as Main Project" are selected.

    In the Projects pane right click the "SSO_JavaTestApplication" project, edit its Properties and select Libraries from the list of Categories.

    In the "Compile-time Libraries" pane select "Add Library" and finally add "SSO_Java_SDK"

    Under "Source Packages" open the Main.java class and replace the existing code with the code attached to this document.

    In the code search for the String "SSO_Server" and "ps-admin_password" and replace it with your actual data.

  6. Prepare the SSO Server

    In the ps-ldap user directory create a user named "Bob" with SSO Authentication Method and password "bob" and assign some applications to him.

    Copy C:\Program Files\CA\Single Sign-On\SDK\JAVA API\release\EtWacJava.dll and C:\Program Files\CA\SC\CAPKI\Windows\x86\32\capki\log\liblog_api.dll to C:\Program Files\CA\Single Sign-On\Server\Bin
    (specific location can be determined by checking the value of the function Configtools.loadJNIDLLs())

  7. Compile the Code and run the Program

    To compile the code select Run / Clean and Build Main Project

    Ensure there are no compilation errors and you see a "BUILD SUCCESSFUL" confirmation in the output pane of the IDE.

    To execute the program select Run / Run Main Project.

    The program is connecting to the SSO Server as ps-admin and Bob and is retrieving Bob's list of applications.
    (Note that it is not necessary to have the SSO Client installed on the box running this program).

Environment

Release: SOASA199000-12.1-SOA Security Manager-w/ SOA Agent Addl CPUs
Component:

Resolution

.

Attachments

1558535451066TEC507530.zip get_app