Wednesday, 26 December 2012

Extensible Security for Tibco EMS by using JAAS

Extensible Authentication:
      The extensible authentication feature uses the Java virtual machine (JVM) and the Java Authentication and Authorization Service (JAAS) to allow you to run your own Java-based authentication module in the EMS server.
           Your authentication module, or LoginModule, runs in the JVM within the EMS server, and is accessed by tibemsd using the JAAS interface. This is a flexible way to extend the security of your EMS application.

Writing an Authentication Module :
                The LoginModule is a custom module that runs inside the EMS server within a JVM. The LoginModule is written using JAAS, a set of APIs provided by Sun Microsystems, and used to create plugable Java applications. JAAS provides the interface between your code and the EMS server. JAAS is a standard part of JRE, and is installed with EMS.

Set up JAAS

jaas_config_file        = "C:\tibco\ems\7.0\bin\security\jaas-config.txt"

# Path to jar file containing customer JAAS implementation
jaas_classpath          = "C:\tibco\ems\7.0\samples\security\SecurityPlugins.jar"

# Customer code must return a result within this many milliseconds
jaas_login_timeout      = 500




Extensible Permissions :
The extensible permissions feature uses the Java virtual machine (JVM) and the Java Access Control Interface (JACI) to allow you to run your own Java-based permissions module in the EMS server.
Your Permissions Module runs in the JVM within the EMS server, and connects to tibemsd using the JACI interface.

 Set up JACI

 Class that implements the com.tibco.tibems.tibemsd.security.Authorizer interface(this class should be available in Jar file).
jaci_class              = com.tibco.example.FlatFilePermissionModule

# Path to jar file containing customer JACI implementation
jaci_classpath          = "C:\tibco\ems\7.0\samples\security\SecurityPlugins.jar"

# Customer code must return a result within this many milliseconds
jaci_timeout            = 500

# If you need to pass configuration parameters to customer JACI code, system
# properties are a good way to do it:

jre_option              = -Dexample.permission.file=C:\tibco\ems\7.0\bin\security\permission.txt

jre_option              = -Dexample.permission.debug=true

To compile and run sample security modules, do the following steps:


 1. Verify the setting of TIBEMS_ROOT environment variable inside     the setup.bat or setup.sh script file.

 2. Make sure your computer has Java 1.6 or greater installed.

 3. Make sure JavaMail API is on your classpath.
    (See example ConfFileUserAuthLoginModule for more information.)

 4. Open console window and change directory to the samples/security
    subdirectory of your TIBCO Enterprise Message Service installation.

 5. run "setup" script.

 6. execute:

    javac com/tibco/example/*.java
   
    jar cf SecurityPlugins.jar com/tibco/example/*.class

the generated  jar file is used in jaci_class path and jass_class path

jaas configuration file:

EMSUserAuthentication {
    com.tibco.example.FlatFileUserAuthLoginModule   required
        debug=true
        filename="C:/tibco/ems/7.0/bin/security/userpass.txt";
};

Permissions File:

Colin > TOPIC_SUBSCRIBE 30
Russ > TOPIC_PUBLISH 10
Bob samp.* TOPIC_SUBSCRIBE,TOPIC_PUBLISH,TOPIC_DURABLE,TOPIC_USE_DURABLE
user1 > QUEUE_SEND
user3 > QUEUE_SEND
user2 > QUEUE_RECEIVE
user4 sam.* QUEUE_SEND
user2 sam.* QUEUE_SEND

Users File:

Colin:guitar!
Russ:photos00
Balbhim:9tennis9
Bob:runner01
user1:user1
user2:user2
user3:user3
user4:user4


tibemsd.conf file is  attached below...

Have fun!!!






Monday, 24 December 2012

Configuring JMS Connection for Weblogic in Tibco BW

Step1:  copy the jar files wlclient.jar,wljmsclient,wls-api (available at bea installation directory\weblogic92\server\lib) to   C:\tibco\tpcl\5.7\lib folder.

Step2: Create a Connection Factory in Weblogic .




Step3 :  Open Tibco designer.
As usually first Right click on Project folder--->selct Add Resource---->JMS---->Select JMS Connection.

Configuration of JMS Connection is like below...


Advanced tab Configuration: Here we have to give the JNDI name of the connection factory.

 

Then test the Connection and Save it...

Have fun!!!!

Thursday, 6 December 2012

Weblogic integration with Sterling Selling and Fulfillment Suite



·         Step1 : For Weblogic initial context factory include the following jars wlclient.jar,wljmsclient,wls-api.jar (bea\weblogic92\server\lib)


·         Don’t add jars other than these three jar files

·         Copy those jars in sterling  extensions\customjars  folder 

Step2: Run below third party jar commands to Add the jar files.


install3rdParty.cmd jboss 4.2.3 -j F:\Sterling\Foundation\extensions\customjars\wlclient.jar -targetJVM APP

install3rdParty.cmd jboss 4.2.3 -j F:\Sterling\Foundation\extensions\customjars\wljmsclient.jar -targetJVM APP
  
install3rdParty.cmd jboss 4.2.3 -j F:\Sterling\Foundation\extensions\customjars\wls-api.jar -targetJVM APP 

Step 3:   Add jars path in properties folder/AGENTDynamicclasspath file like

VENDOR_JAR=F:\Sterling\Foundation\jar\jboss\4.2.3\wlclient.jar

VENDOR_JAR=F:\Sterling\Foundation\jar\jboss\4.2.3\wls-api.jar

VENDOR_JAR=F:\Sterling\Foundation\jar\jboss\4.2.3\wljmsclient.jar

·       Step 4 : Run setupfiles.cmd

·      Step 5 : Build smcfs and deploy in jboss 
Step 6 : Configure the Service like below...


 
 

S         QCF Lookup Name and Queue Names should be JNDI names given at Weblogic for Connection Factory and Queue .
 
Step 7: Run the Service through Http API Tester and check.
      
    Have fun!!!!!