• Entries (RSS)
  • Comments (RSS)

Retrieving Merchant Key value from WebSphere Commerce Server

Posted by | Posted in WebSphere Commerce | Posted on 23-08-2010

Tagged Under : , , ,

Retrieving Merchant Key value from WebSphere Commerce Server

Merchant Key

The merchant key is the encryption key used in WebSphere Commerce Server. Merchant key is a 16 digit hexadecimal number that has at least one numeric character, at least one alphabetic character (a-f) with no upper case letter. The merchant key cannot contain the same character more than four times and four consecutive occurrence of the same character is not allowed. The merchant key will be present in WebSphere commerce instance xml file in encrypted format. To get the plain text version of the merchant key, place the following text in any WCS view and run it on the server.

<%
	System.out.println("Merchant Key :"+com.ibm.commerce.server.ConfigProperties.singleton().getMerchantKey());
%>

Reset password in WCS

Posted by | Posted in WebSphere Commerce | Posted on 22-08-2010

Tagged Under : , , ,

Resetting user password in WCS

There will be situations where you may have forgotten the password of a user and you want to reset the password in WCS. In WebSphere Commerce all the passwords are one way encrypted with a salt and Merchant Key. The main purpose of a salt is to add more security to storing passwords. With the help of Salt during encrypting the password, WCS makes sure that two users that have the same password will not have the same encrypted string as their password.

Reset by updating DB
Resetting the password is easy if you already know the password of at least one user. For e.g.: if you already know the password of user with users_id 9000 and you want to reset the password of user with users_id = 9001, then execute the following query in the database.

UPDATE USERREG SET LOGONPASSWORD = (SELECT LOGONPASSWORD FROM USERREG WHERE USERS_ID = 9000), SALT = (SELECT SALT FROM USERREG WHERE USERS_ID = 9000), PASSWORDINVALID= (SELECT PASSWORDINVALID FROM USERREG WHERE USERS_ID = 9000), STATUS = (SELECT STATUS FROM USERREG WHERE USERS_ID = 9000) WHERE USERS_ID=9001;

Now user 9001 can login with user 9000′s password. In the above case we copied the details like salt, logonpassword etc of user 9000 to user 9001

Reset with the help of wcs_password utility.
Consider case where you do not know the password any of the users. Now to reset the password you need to generate the password by yourself. To generate the encrypted password for any string, WCS has a utility, ‘wcs_password’. wcs_password utility takes three parameter as the input. The syntax for wcs_password utility is given below

wcs_password <password> <salt> <key>

Where password is the new password, salt is the salt for the user and key is the Merchant Key

Once we provide all these details, the command will give the encrypted password in both ASCII and hex format. Take the ASCII formatted string and update the USERREG.LOGONPASSWORD column with that value. E.g.: The SQL to update the password for wcsadmin is given below

update userreg set logonpassword='output of wcs_password utility' where logonid = 'wcsadmin'

Now you can login with the new password.

The wcs_password.bat utility will be available in your bin directory.

Reset with chgwcspwd utility
The third way of resetting the password is with the help of chgwcspwd utility. This utility changes the password directly in the db. So we do not need to execute any SQL commands by our own. But this tool is available only in IBM iSeries. So I have not tried this yet. The syntax to use this utility is

chgwcspwd.sh -database <dbname> -dbHostname <db host name> -schema <schema name> -instance <instance name> -instancePwd <db password>-merKey <key> -wcsUser <wcs username> -wcsUserPwd <user's new password>

Modifying the destination of selector

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 10-05-2010

Tagged Under : , ,

Modifying the destination of selector

Now we know how to create and configure selector. But after deployment of selector, how do we change the destination of a selector? WebSphere Process Server provides an interface in the admin console to change or add the destination of a selector. Follow the below steps to change/add destination of a selector.

We can use process server admin console to change the selector’s destination. For e.g.: If we have a selector deployed on the server pointing to Component1 and now we want to change the destination to Component2. Follow the below steps to achieve this.

Read the rest of this entry »

Selectors in WebSphere Integration Developer

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 04-05-2010

Tagged Under : , , , ,

Selectors in WebSphere Integration Developer

A selector is a component that determines which implementation of a component should be invoked at run time based on a set of selection criteria. Every selector will have a default destination. When a selector is invoked it determines which component to invoke based on the date range entries and the selection criteria. A selector can route to any service component at run time.

Creating a Selector
Follow the below steps to create a selector

1. Right click on the module and select New ->Selector.

2. This will open the New Selector window. Enter the name for your selector. I have named it as MySelector. Click on Next.

3. In this page, we need to select the interface for the selector. I have used HelloInterface for this purpose.

4. Click Finish

Configuring the selector
Once we created our selector, we need to configure the selector. Open the selector in selector editor. Follow the below steps to configure the selector.

1. Click on ‘Enter SCA Component’ to configure the Default Component. This will list all the components available. (This will list only components that are having a matching interface). Select the component you want as the default component.

It is very important to provide the default component as an exception will be thrown if no selection criteria matches and no default component present.

2. Click on ‘Add Date selection entry’ icon (the + icon marked in the image).

3. Configure the dates.

My selector is configured to select component2 if the date range is May 01, 2010 to may 04, 2010.

4. Configure the ‘Selection Criteria’. Here we have three options to configure. Current Date, Java, and XPath. This should return a date.

Now add this selector to the assembly diagram and invoke when you want to route a service call dynamically to a component.

For those who want to try this, here is the PI for this example. HelloSelector

Find the version in WebSphere Commerce Developer

Posted by | Posted in WebSphere Commerce | Posted on 16-03-2010

Tagged Under : , , ,

Finding the version of WebSphere Commerce Developer.

Have you ever came across a situation like you want to know the version of WebSphere Commerce Product you are using and have no idea where to look for? I had. I know how to do this in WebSphere Commerce Developer 5.6.1 and the previous versions but not in WCS 6.

So to find the location of WebSphere Commerce Developer’s version, go to %WC_DEVELOPER_INSTALl_DIR%\properties\version\ and open file COMMERCE.product. In this file you can see a tag named version. This tag will have the version of WebSphere Commerce we are using.