Skip to main content

Posts

Showing posts from April, 2015

Deploy InfoRecoverySample in WSO2 IS

Steps: WSO2IS 5.0.0 1. Download the source code from https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/is/5.1.0/modules/samples/InfoRecoverySample/ 2. Configure the following in web.xml file a. Specify the "carbonServerUrl" with the URL of the Identity Server. eg: https://localhost:9443 b. Specify the credentials to access Identity Server, "accessUsername" as admin and "accessPassword" as admin. c. Specify the trustStore absolute resource path for "trustStorePath", eg: <IS_HOME> /repository/resources/security/client-truststore.jks 3. Update the following entry in sso.properties file SAML.ConsumerUrl= https://localhost:9443/InfoRecoverySample/home.jsp 4. Exclude the slf4j-api jar from pom.xml file. <dependency>   <groupId> org.wso2.carbon </groupId>   <artifactId> org.wso2.carbon.identity.sso.agent </artifactId>   <version> 1.2.0 </version>   

Configure Active Directory as a Secondary User Store

Prerequisites: Install and configure Active directory with WSO2 IS 5.0.0 http://pavithramadurangi.blogspot.com/2015/01/configuring-ad-in-windows-2012-r2-to-be.html http://social.technet.microsoft.com/wiki/contents/articles/2980.ldap-over-ssl-ldaps-certificate.aspx Steps to configure secondary user store: 1. Login as admin/admin 2. Go to Configure -> User Store Management, Add secondary user store, give the information as shown in the image, click update Refer  https://docs.wso2.com/display/IS500/Configuring+Secondary+User+Stores Verify: 1. The secondary user store configuration should be found at the following location <IS_HOME>/repository/deployment/server/userstores/ADSUS.xml 2. Create a new user in secondary user store and check that user can login to the management console. Go to configure -> User and Roles -> Users -> Add New User (ex: aduser) Select the domain ADSUS and give the user details and Finish Go to Roles and give the lo

VFS to SFTP cannot access absolute paths

Learn WSO2 ESB VFS Transport https://docs.wso2.com/display/ESB481/VFS+Transport When sending or receiving files with VFS transport to a SFTP folder, the specified path is relative to the user home, not a absolute path. Eg:  If the URL is vfs:sftp://user:password@ftp.server.com/myPath, the file will be stored at /home/user/myPath not in /myPath This is how SFTP protocol works. SFTP uses SSH protocol to communicate with the server, so it always log in to the users home directory and then it takes the path relative to the user home directory. That is why this behavior occurs. If you need to access the different location instead of user home Solution 1: This is not supported in WSO2 ESB 4.8.1. So as a workaroud you can mount /myPath to the /home/user/myPath location and then make sure user have access to the /myPath. mount --bind /myPath /home/user/myPath Solution 2: This will be available in next version WSO2 ESB 4.9.0. "sftpPathFromRoot=true" nee

Run multiple samples without restarting the WSO2 ESB

WSO2 ESB includes working examples that demonstrate its features and capabilities. https://docs.wso2.com/display/ESB481/Samples When executing ESB samples, each time we need to restart the ESB server as: Please note: if a given sample required to change axis2.xml file or add some libraries to the ESB, then need to restart the ESB. ./wso2esb-samples.sh -sn 0 https://docs.wso2.com/display/ESB481/Setting+Up+the+ESB+Samples#SettingUptheESBSamples-Startingasample How to run multiple samples without restarting the WSO2 ESB: Solution 1: The simplest way is just copy the configuration from the ESB docs and paste it on ESB source view and update: then it will deploy the new synapse config to the ESB_HOME/repository/deployment/server/synapse-configs/default Solution 2: Create a CAR file and deploy it to the ESB. We can use the WSO2 Developer Studio for create CAR files https://docs.wso2.com/display/DVS371/Packaging+Artifacts+Into+Deployable+Archive

VFS access SFTP with special character password

Learn WSO2 ESB VFS Transport https://docs.wso2.com/display/ESB481/VFS+Transport When we need to access the FTP server using SFTP, VFS connection-specific URL need to be given as : <parameter name="transport.vfs.FileURI">vfs:sftp://username:p@ssword@ftp.server.com/filePath?vfs.passive=true</parameter> When the password contains a special characters (eg: p@ssword), it gives the following error. 2015-03-27 13:06:03,766  [-]   [PassThroughMessageProcessor-5]  ERROR VFSTransportSender cannot resolve replyFile org.apache.commons.vfs2.FileSystemException: Invalid absolute URI "sftp://username:***@ftp.server.com/filePath?vfs.passive=true". Solution 1: Replace the special characters with the respective hex representation. <parameter name="transport.vfs.FileURI">vfs:sftp://username:p%40ssword@ftp.server.com/filePath?vfs.passive=true</parameter> Char Hex Code ------- -------- [space] %20 &

Send email via WSO2 ESB with several attachments

WSO2 ESB Mail transport allows you to send a email only with 1 attachment. If you want to send number of attachments here's the solution. Scenario: Here I want to extract some content from the input message and attach to the email as two different attachment. Solution:  You can achieve this requirement using Gmail connector. Steps:  Add the Gmail connector to the ESB and enable it. You can download the esb connector here https://storepreview.wso2.com/store/assets/esbconnector/a1fba975-89fb-4bb0-a1b9-9f9d061fb31c Add it to the ESB and enable it https://docs.wso2.com/display/ESB481/Managing+Connectors+in+Your+ESB+Instance Gmail connector documentation https://docs.wso2.com/display/ESBCONNECTORS/Gmail+Connector Setup the scenario: split the input message and send it with an email using two different attachments. Input message I used <email>         <username>sender@gmail.com</username>         <password>password&