Saturday, July 27, 2019

Importance of Daily Scrum Meeting and Sprint Retrospective

Importance of Daily Scrum Meeting


What is a Daily Scrum Meeting?

A Scrum meeting is usually held for Projects that are focusing on Agile Development or a company that is adopted for Scrum practices. Daily Scrum is a meeting that is held every working day, usually it scheduled in the morning and will last for maximum of 15 minutes. It is time-boxed to 15 minutes to keep the discussion short and to discuss only the important.

The Daily Scrum meeting is basically a status update. All the members of the team needs to participate in this meeting including the Product Owner, Scrum Master plus the team.

This meeting is beneficial for the following reasons:

  • Building the trust between the team members
  • Check the sprint is on track and to get to know whether there are road blocks or impediments to achieve the final sprint goal
  • Getting the chance to speak and express your ideas in case someone is having impediments
  • Helps you to plan ahead of your tasks.
In this meeting everyone needs answer the following questions:
  • What tasks did you do yesterday?
  • What tasks are you planning to do today?
  • What are the impediments you are facing, if you have any?
This meeting improves the team work, and the individual commitment within the team. 

Importance of Sprint Retrospective



The Sprint Retrospective is held at the end of the sprint, basically after the sprint review and before the start of the next Sprint Planning. This meeting can last for 2 or 3 hours depending on the number of team members and the complexity of the things that will be discussed. This meeting is scheduled by the Scrum Master and in some companies there will be one internal retrospective and  the actual retrospective. In the Internal Retrospective, the Scrum Master and Team will join and discuss all what happened in the sprint in detail and find solutions to problems if there were any. However the Actual Retrospective will be held with the Product Owner, Scrum Master and Team and usually will be limited to discussing the important points. 

During the Sprint Retrospective the team discusses the following:

What went well in the Sprint?
What didn't go well in the Sprint?
What can be improved?
What are the actions that will be taken to improve?

This meeting will help to improve the trust between the team, compliment each other for their hard work, Help out each other who was having impediments and to ensure that everybody is part of a team and no one is alone. 

This meeting will improve the quality of the product as improvements are discussed and the actions are noted to be taken, and will be practiced from next Sprint on wards. 

Sunday, March 10, 2019

How to do Regression Testing in a SCRUM Project?

What is Regression Testing?

In simple words regression testing is testing again what has already been tested. This testing is done when a modification, code changes or a new functionality added to the system. We do this testing to ensure that the modification will not affect the existing functionality which was perfectly working fine earlier.

When to do Regression Testing?

Whenever a modification is done, it is not feasible to do regression testing. So we have to come up with a plan. If we follow agile we can break several tasks for regression within the Sprint and we can carry out regression testing based on the milestones defined within the sprint. (Eg: Milestones: A date when a specific functionality or two being released and tested). This will ensure the existing functions are working as expected despite there are modification done time to time. If Waterfall once a modification is done to an existing functionality , better to do regression testing for that affecting module only.

You will have to run through all the test cases that's been executed so far which is related to that module and do a high-level testing based on those test cases.

Some Regression Testing Examples (When we need to do regression testing?)

1. When new functionality is added to the system
2. When there is a Change Request
3. When there is a modification in code

However, it is up to the team to plan the regression testing properly without doing it all the time.

I have noticed some teams doing regression testing at the end of the UAT cycle saying they are covering all the end to end test cases. However, it is not how the way it should be done. The testing you do after an UAT cycle which caters end to end is basically system testing.

However different teams follow different methodologies and they have different definitions for these testing approaches. This way I mentioned is what I practiced for a long period.


Sunday, February 24, 2019

How to write a Test Scenario?

What is a Test Scenario?

According to my understanding, one functionality can have many Test Scenarios and one Test Scenario can have many test cases. We are writing test scenarios or keeping track of test scenarios because it is an definite aid for our End to end testing. For end to end testing we cannot be executing all the test cases, so we have a set of test scenarios covering all the functionalities in a high level way.


How to prepare Test Scenarios?

Go through the functional spec or the backlog item and determine all the use cases or basically high level scenarios that you have to test. Basically you figure out these first and narrow down the test scenarios to test cases.

Example of How to come up with Test Scenarios for a particular functionality?
Assume the functionality you have to test is purchasing Unit trust which can be Lump sum or Monthly and which can be paid using different payment methods like Cash, SRS or CPF? Minimum amount for purchasing is $1000. Purchased funds are visible to customer.

So basically you can come up with following test scenarios:
  • Purchase Lump Sum unit trust
  • Purchase Monthly unit trust
  • Purchase both monthly and Lump sum unit trust together
  • Purchase unit trust with different payment methods
  • Can't purchase due to Account having not sufficient funds
You can derive test cases as the following:
  • Verify Lump Sum field only accepts numeric
  • Verify Lump Sum field minimum should accept $1000
  • Verify Monthly field only accepts numeric
  • Verify Monthly field minimum should accept $1000
  • Verify when Lump Sum unit trust is purchased, it is displayed to customer
  • Verify when Monthly unit trust is purchased, it is displayed to customer 
  • Verify the records in backend whether purchase successful
  • Verify pay with Cash
  • Verify pay with CPF
  • Verify pay with SRS
  • Verify pay with Cash/ CPF/ SRS when customer don't have the relevant account
  • Verify the error message displayed when customer don't have sufficient funds
  • Verify purchasing unsuccessful screen

Hope this article helps to identify the differences between Test scenario and Test case.

Saturday, February 23, 2019

How I practiced Scrum as a QA member?

The Scrum Process I followed

First of all the client is going to create a Product Backlog using Visual Studio Team Foundation Server. The Product Backlog includes all the Backlog items that should be implemented. Backlog item is a specific user story which includes the acceptance criteria for that particular user stories. Like that 100+ backlog items will be there in the Product Backlog.

Prioritization of Product Backlog Items 

The product owner or client will prioritize the backlog items based on the urgency of implementation. Once the backlog items are prioritized the Scrum Master will take several prioritized backlog items to a Sprint. 

What is a Sprint?

A sprint usually will be timed for one month or less than a month. I followed 21 working days Sprint. At the end of a Sprint an usable and potentially releasable product will be released to the Product owner or client. This product we create is incremental and iterative. It will take a few more sprints to complete the Product with all the functionalities yet each Sprint delivers a workable product to customer. A new sprint will start immediately after a Sprint is finished.

Task Breakdown and Task Estimation
The Scrum Master will assign prioritized backlog items for each sprint. Then the team as a whole will divide tasks for each backlog items. Each backlog item will have 2 or 3 development tasks and one QA task. Then the developers will be estimating the hours for each development task using planning poker technique also the QA task will be estimated by QA members in the team using the same planning poker technique. 
Note : This task breakdown and task estimation is done on the Day 1 of the Sprint. 

Buffer time and additional QA tasks per Sprint

Additionally to the tasks breakdown for each backlog item that are taken into the sprint, the team will create few more tasks for QA. Eg: Performance testing task, Integration testing task, Regression Testing task, Automation Testing Task, Test case Creation Task and Test case Review task. Also developers will have their own common tasks created. All these tasks will be estimated using planning poker technique. Usually there will be one internal demo task, Sprint Review task and Sprint Retrospective task included within the sprint. 
Usually team decides how much buffer time needs to be included within a sprint because we never know what will go wrong within a sprint. Buffer time will usually be 1 or 2 days within a Sprint.


What is Sprint Retrospective?

This meeting is normally hosted by Scrum Master. It usually takes place after the Sprint Review and before the next Sprint starts. During the Sprint Retrospective, the team discusses:
  • What went well in the Sprint?
  • What could be improved?
  • What will we commit to improve in the next Sprint?


What is Daily Scrum Meeting?

The Scrum Master, the team and the Product Owner usually sits for this Daily Scrum Meeting. 

During the daily scrum, each team member answers the following three questions:
What did you do yesterday?
  • What will you do today?
  • Are there any impediments in your way?
  • The impediments will be discussed offline after the Scrum meeting.

If any questions happy to answer more!

Thursday, March 3, 2016

Facebook as a Federated Identity Provider in WSO2 Identity Server

Who will not like to use one username and password for all their logins? Today it is not necessary to memorize lot of usernames and passwords to login to different applications. Most of the applications/websites support Facebook/Google/Windows Live authentication so people can easily login to different applications from their Google authentication credentials or may be their Facebook credentials or may be their Windows Live credentials.

In this blog post my aim is to cover up how to login to an application using your Facebook credentials with WSO2 Identity Server.

Prerequsities :


Steps :

1. Configuring the Facebook App
2. Configuring the travelocity SSO sample
3. Configuring Identity Provider
4. Configuring Service Provider
5. Configuring Claim Mappings for Facebook


Configuring the Facebook App


Follow [1] to configure the Facebook App and get the App ID and secret generated for the application



Configure the travelocity SSO Sample


To obtain and configure the single sign-on sample, follow the steps below :

1. You can check out the repository of the SSO sample from GitHub. - https://github.com/wso2/product-is/tree/master/modules/samples/sso 

2. In your command line, navigate to <SAMPLE_HOME>/sso in the folder you checked out and build the sample using mvn clean install. You must have Apache Maven installed to do this.
After successfully building the sample, a .war file named travelocity.com can be found inside the <HOME>/sso/SSOAgentSample/ target folder. Deploy this sample web app on a web container. To do this, use the Apache Tomcat server.

3. Use the following steps to deploy the web app in the web container:
  •   Stop the Apache Tomcat server if it is already running.
  •   Copy the travelocity.war file to the <TOMCAT_HOME>/webapps folder.
  •   Start the Apache Tomcat server. 

Configure Identity Provider


To configure Facebook as the Identity Provider, you have to Log into Identity Server, and in the main tab in the Identity Providers section, click Add

Provide a "Identity Provider Name" and Expand Federated Authenticators > Facebook Configuration and give the App ID and App secret of your Facebook application. User Information fields are some of the claims that are supported by Facebook and you should map them with Identity Server claims later on for Facebook authentication. Claim mappings will be done in further steps


Make sure to Tick both the check boxes to enable the Facebook authenticator.


Configure Service Provider


Go to Service Provider > Add, and create a service provider to register the travelocity application.  Give "travelocity.com" as the Service Provider Name and expand Inbound Authentication Configuration > SAML2 Web SSO Configuration and fill the following details :



Issuer : travelocity.com
Assertion Consumer URLs : http://localhost:8080/travelocity.com/home.jsp
Enable Response Signing
Enable Single Logout
Tick Enable Attribute Profile and Include Attributes in Response Always

Click on Update to save the changes and you will be directed back to the service provider page. Here expand Local & Outbound Authentication Configuration and select Federated Authentication radio button and select "Facebook" as the IDP. Save all the changes.


Configure Claim Mappings for Facebook


Go to the Identity Provider created for Facebook and expand Claim Configuration > Basic Claim Configuration
  • Select Define Custom Claim Dialect
  • Click Add Claim Mapping
Here Facebook has different attributes/claims that are supported to retrieve all the public information of the user. So these claims should be mapped with any Local Claim URI that is supported by WSO2 Identity server.

Some of the Facebook Supported Claims :
  • id
  • email
  • name
  • first_name
  • last_name
  • link
  • gender
  • locale
  • age_range


Now you have to configure the requested claims for travelocity.com. Go to the Service Provider created for travelocity.com and expand the Claim Configuration.

Click "Add Claim URI" for Requested Claims, Here you should add the claims you mapped in the Identity Provider claim configuration. 


Select Subject Claim URI as email (To use email as the Subject Claim URI you have to Enable Email authentication. Please follow [2] )


Now the configurations are done. To check how this works, access http://localhost:8080/travelocity.com

You will be directed to the travelocity application. When you click on to Login with SAML, you would be directed to Facebook authentication. Enter your Facebook credentials and log into the application.




Thursday, February 11, 2016

How to Configure WSO2 Identity Server's Travelocity Sample Application in Tenant Domain

In this blog post my aim is to cover how to register the travelocity application in tenant domain.

Prerequsities :

Download WSO2 Identity Server 5.1.0 



Steps to Follow :


1. Configure the travelocity SSO web application
2. Configure the Service Provider in Tenant Domain
3. Configuring the travelocity SSO application properties file
4. Running the Sample


Configure the travelocity SSO web application

 

To obtain and configure the single sign-on sample, follow the steps below.

  1. You can check out the repository of the SSO sample from GitHub. - https://github.com/wso2/product-is/tree/master/modules/samples/sso 
  2. In your command line, navigate to <SAMPLE_HOME>/sso in the folder you checked out and build the sample using mvn clean install. You must have Apache Maven installed to do this.
  3.  After successfully building the sample, a .war file named travelocity.com can be found inside the <HOME>/sso/SSOAgentSample/ target folder. Deploy this sample web app on a web container. To do this, use the Apache Tomcat server.
  4. Use the following steps to deploy the web app in the web container:
        Stop the Apache Tomcat server if it is already running.
        Copy the travelocity.war file to the <TOMCAT_HOME>/webapps folder.
        Start the Apache Tomcat server. 

Configure the Service Provider in Tenant Domain 


The next step is to configure travelocity.com as service provider in tenant domain. For this you have to first create tenant domain using WSO2 Identity Server

Steps to Create Tenant Domain  :

1.Login to Identity Server with admin/admin credentials
2.Go to Configure Tab > Add New Tenant



Steps to Create the Service Provider in Tenant Domain :

1.Login to Identity Server with the tenant admin credentials ( tenant@wso2.com)

2.Next navigate to the Main menu and click Add under Service Provider 

3.Expand the Inbound Authentication Configuration section and then expand SAML2 Web SSO Configuration.  



 Issuer : travelocity.com
 Assertion Consumer URL : http://localhost:8080/travelocity.com/home.jsp
 Enable Response Signing
 Enable Single Logout 

4.Save the Service Provider Configuration.

5.Next you have to export the public certificate of the private key used at webapp side to sign the SAML Authentication Request. Following command can be used to export it.

keytool -export -alias travelocity -file travelocity -keystore <path to wso2carbon.jks> '''

6.Import the above exported public certificate to the tenant key store of the internal IDP, identity server as below. 



 7. After the import it will be listed as the following :


8. Edit the Service Provider Configuration and select "travelocity" as the Certificate Alias.


9. The configurations are mostly done to get the SSO scenario work with the webapp. We need to export the tenant public certificate to be imported to the trust store at webapp side. This is in order to verify the SAML Response/Assertion signed signature at the webapp side. We can export the certificate as below from the UI, using public key link.



 10. The exported key needs to be imported to webapp truststore(in this case wso2carbon.jks located inside the {Tomcat_Home}/webapps/travelocity.com/WEB_INF/classes

 keytool -import -alias <The given alias name. Here travel.com> -file <path to downloaded public certificate> -keystore <path to trust store of webapp. Here the wso2carbon.jks file> 


 Configuring the travelocity SSO application properties file


Now you have to change the following properties in the travelocity.properties file located in {Tomcat_Home}/webapps/travelocity.com/WEB_INF/classes

Approach 1 :

 
SAML2.SPEntityId=travelocity.com@wso2.com (Here you have to add the Service Provider issuer name appended with the tenant domain)

IdPPublicCertAlias=travel.com (This is the alias you gave when executing Step 10 in Configuring the Service Provider to import the tenant public certificate   to web app)

 Approach 2 :


Apart from the above their is another way that you can specify the tenant domain in travelocity properties file. You can try the above mentioned way, or either the below mentioned way. You can pass the tenant domain as QueryParams as follows:

Give the SAML2.SPEntityID = travelocity.com

Uncomment the following in the propertied file :

QueryParams=tenantDomain=wso2.co

IdPPublicCertAlias=travel.com


Now you can test the SSO with travelocity application and login with tenant domain.


Running the Sample

 

Visit http://localhost:8080/travelocity.com . You are directed to the following page:


Since you need to use SAML2 for this sample, click the first link, i.e., Click here to login with SAML from Identity Server. You are redirected to the Identity Server for authentication.

 Enter Tenant Admin credentials and you'd be able to successfully log in.

  
 

Friday, January 8, 2016

Configuring Single Sign-on with SAML 2.0 for WSO2 Dashboard Server 2.0

The Actual Configurations for SSO and How to get it Working..

 

Prerequisites :

 

Identity Server 5.1.0 (Download : http://wso2.com/products/identity-server/)
Dashboard Server 2.0.0 (Download : https://github.com/wso2/product-ds/releases/tag/v2.0.0-beta)

Configurations for both DS and IS to point to a common User database/store.

1. Create a MySQL database (e.g., ustore) and run the <DS_HOME>/dbscripts/mysql.sql script on it to create the required tables.
2.Open <DS_HOME>/repository/conf/datasources/master-datasources.xml file and add the datasource configuration for the database that you use for the shared user store and user management information. For example,

3. Open <DS_HOME>/repository/conf/user-mgt.xml file and point to jdbc/ustore.
<Property name="dataSource">jdbc/ustore</Property>
Note - DS will have the the jdbc user store as the default user store. So in the same file the jdbcUserStoreManager will be uncommented. Leave it as it is.

4.Open <IS_HOME>/repository/conf/datasources/master-datasources.xml file and add the USTORE datasource that you added to DS listed above. So now both IS and DS will point to the same database.

5. Open <IS_HOME>/repository/conf/user-mgt.xml and point to jdbc/ustore
<Property name="dataSource">jdbc/ustore</Property>
Note - IS will have the ldap user store as the default user store. So you have to comment out the ldap configuration and uncomment the jdbc user store in the same file. So both DS and IS will be accessing one common user store.

6. Open <IS_HOME>/repository/conf/identity/embedded-ldap.xml and disable the embedded ldap by setting  <Property name="enable">false</Property> within <EmbeddedLDAP> tags.

Now Both DS and IS will be pointing to one common user store..

7. Remember to copy the database driver into  <DS_HOME>/repository/components/lib> and <IS_HOME>/repository/components/lib and restart the servers


Now Let's Register the Dashboard Server portal as Service Providers in IS


1. Start the IS pack
2. Go to IS Management Console > Main > Service Providers > Add
3. Give a unique name for service provider and click Register
4. Click on Inbound Authentication Configuration > SAML2 Web SSO Configuration > Configure
5. Fill on the details as follows for the DS portal



Note - Assertion Consumer URL has my local/machine ip address. Configure it with your correct ip address and my Dashboard Server is running on port 9444 which I have stated the offset as 1. This will be done in the future steps.

Now the Service Provider is successfully registered.

Now Let's Do the Configurations for Dashboard Server to Enable SSO with WSO2 Identity Server

 

1. Open <DS_HOME>/repository/conf/carbon.xml and change the offset to 1
2. Open <DS_HOME>/repository/deployment/server/jaggeryapps/portal/configs/designer.json

"authentication": {
    "activeMethod": "sso",
    "methods": {
      "sso": {
        "attributes": {
          "issuer": "ues",
          "identityProviderURL": "https://10.100.7.57:9443/samlsso",
          "responseSigningEnabled": "true",
          "acs": "https://10.100.7.57:9443/portal/acs",
          "identityAlias": "wso2carbon",
          "useTenantKey": false
        }
      },
      "basic": {
        "attributes": {}
      }
    }
  }

Here the identityProviderURL will point to the IS and the issuer is given as "ues" since when we were adding the service provider for the Dashboard Portal we gave the issuer as "ues". Both should be the same.

Also "activeMethod" should be changed from "basic" to "sso"
"acs" is the Dashboard Server portal acs URL

Now We are Done with the Configurations!!

Start the DS server and Open up a Browser. Hit the portal URL (https://10.100.7.57:9444/portal). You should be directed to the IS login. Enter admin/admin username/password and sign in.

Following is the IS login page that you will be directed to :



Friday, November 13, 2015

Security Testing with ZAP 2.4.2

Using ZAP 2.4.2 you can easily capture vulnerabilities in web applications. From this blog post my aim is to explain step by step how to do penetration testing using ZAP 2.4.2 to identify any vulnerabilities your site might hold

Getting Started

Once you start ZAP you will see a quick start tab. Simply insert the url of your web application and start the attack. ZAP will crawl through all the URLs which matches with the URL domain that you have specified.


Once you start the attack ZAP will crawl through your web application and record all url’s from your domain. It will skip url’s that point to other domains. In the second step it will run different attack scenarios against the found url’s and record the results.
As you can see this quick start entering the URL and doing the attack is just a basic security check for your application. The spider only finds url’s that were linked from the initial page. In order to find more security vulnerability and do more penetration testing you have to access more pages than the initial page.

For that you have to configure ZAP as a proxy and then record whatever scenarios you want, go to whatever pages you want and make a zap test script as you wish.

Configure ZAP as Proxy

To do this you have to configure a proxy setting in your browser and same proxy port should be configured in ZAP, so when you are browsing your web application from your browser, ZAP will listen  and record the requests/traffic and later on you can playback as an attack what is recorded 


How to Configure Your Browser to Use Proxy

Go to Firefox > Options > Network > Settings. Tick the "Manual Proxy Configuration" and enter the proxy port  ( eg:8090). Tick "Use this Proxy for server for all protocols" and Save


How to Configure ZAP as Proxy

Open ZAP -> Tools -> Options -> Local Proxy. Configure the address and port on which ZAP will listen for requests.

Address: localhost
Port: 8090

Once you browse through the website ZAP will automatically record the traffic. In the Sites window you will find all websites and requests that ZAP recorded and will be broke-down according to different domains.



Now you can click on the active scan selecting which site you need to attack. Once the attack is complete you can see the high flags, medium flags and low flags to identity the security vulnerabilities  your site is having.

Click on the ALERTS section to find out about the status of the alerts.


That's it. Hope this would be helpful.

Sunday, October 4, 2015

IDP initiated SAML2 SSO with WSO2 Identitiy Server

In an IdP-initiated use case, the identity provider is configured with specialized links that refer to the desired service providers. These links actually refer to the local IdP's Single Sign-On Service and pass parameters to the service identifying the remote SP. So instead of visiting the SP directly, the user accesses the IdP site and get access to the remote SP.

Prerequisites

 Steps

 

1. Enable IDP initiated SAML SSO for the Service Provider
2. Constructing the GET request for IDP initiated SSO
3. Constructing the GET request for IDP initiated SSO for Non Super Tenant Domain

Enable IDP initiated SAML SSO for the Service Provider 

 To enable IDP initiated SAML SSO you need to tick on “Enable IdP Initiated SSO” check box in SAML2 SSO issuer configuration ( SAML SSO Service Provider for travelocity.com if you have followed SAML SSO with WSO2 Identity Server )



Constructing the GET request for IDP initiated SSO 

 

To construct the GET request you need to follow this pattern. You will be directly calling the IDP with the GET request.

https://{Hostname}:{Port}/samlsso?spEntityID={SAML2 SSO Issuer name given to the Service Provider created} 

 If you are running Identity Server in 9443 port localhost and your Service Provider Issuer name = travelocity.com, The GET request will be as follows :

https://localhost:9443/samlsso?spEntityID=travelocity.com 

 

 Constructing the GET request for IDP initiated SSO for Non Super Tenant Domain 

If your SAML2 SSO issuer has been configured in a separate tenant other than super tenant, then you need to append the tenantDomain parameter as well.


Note that in travelocity.properties if you have changed the Issuer specifically for the tenant domain with your tenant domain, you need to append it to the issuer as well.

For example if your tenant domain is ymc.com and if you have changed the issuer in travelocity.properties  as travelocity.com@ymc.com, you need to use that as the issuer in GET request.

Example GET for tenant domain

https://localhost:9443/samlsso?spEntityID=travelocity.com@ymc.com&tenantDomain=ymc.com 

When you do the GET request, you will be directed to the IS login page.


Saturday, July 11, 2015

How to Install a New Key Store into WSO2 Enterprise Store


You can create a new key store, get the public certificate signed and get your public certificate exported from the key store and imported to trust store following 1,2 and 3 steps documented in the following blog - Hasini's Blog - Install a New Key store

After you have completed creating the new key store from the above steps next is to configure WSO2 Enterprise Store to work with the new key store.

Change the Configuration Files

 

1. Change the carbon.xml in [Product_Home]/repository/conf


 <KeyStore>
            <!-- Keystore file location-->
            <Location>${carbon.home}/repository/resources/security/mykeystore.jks</Location>
            <!-- Keystore type (JKS/PKCS12 etc.)-->
            <Type>JKS</Type>
            <!-- Keystore password-->
            <Password>mypkpassword</Password>
            <!-- Private Key alias-->
            <KeyAlias>mycert</KeyAlias>
            <!-- Private Key password-->
            <KeyPassword>mypkpassword</KeyPassword>
    </KeyStore>


<RegistryKeyStore>
            <!-- Keystore file location-->
            <Location>${carbon.home}/repository/resources/security/mykeystore.jks</Location>
            <!-- Keystore type (JKS/PKCS12 etc.)-->
            <Type>JKS</Type>
            <!-- Keystore password-->
            <Password>mypkpassword</Password>
            <!-- Private Key alias-->
            <KeyAlias>mycert</KeyAlias>
            <!-- Private Key password-->
            <KeyPassword>mypkpassword</KeyPassword>
 </RegistryKeyStore>

2. Change the catalina-server.xml in [Product_Home]/repository/conf/tomcat


This configuration resists under Connector protocl - port 9443

keystoreFile="${carbon.home}/repository/resources/security/mykeystore.jks"
keystorePass="mypkpassword"

3. Change the publisher.json in [Product_Home]/repository/deployment/server/jaggeryapps/publisher/config

You have to change this file in-order to authenticate successfully for the Enterprise Store - Publisher. If these configuration is not done you will not be able to login to publisher. The identityAlias should be the alias you use to import the pem details of your key to the client-trustore.jks

"authentication": {
        "activeMethod": "sso",
        "methods": {
            "sso": {
                "attributes": {
                    "issuer": "publisher",
                    "identityProviderURL": "%https.carbon.local.ip%/samlsso",
                    "identityAlias": "mynewcert",
                    "responseSigningEnabled": "true",
                    "acs": "%https.host%/publisher/acs",
                    "useTenantKey": false
                }
        }

4. Change the store.json in [Product_Home]/repository/deployment/server/jaggeryapps/store/config


You have to change this file in-order to authenticate successfully for the Enterprise Store - Store. If these configuration is not done you will not be able to login to store. The identityAlias should be the alias you use to import the pem details of your key to the client-trustore.jks


"authentication": {
        "activeMethod": "sso",
        "methods": {
            "sso": {
                "attributes": {
                    "issuer": "store",
                    "identityProviderURL": "%https.carbon.local.ip%/samlsso",
                    "identityAlias": "mynewcert",
                    "responseSigningEnabled": "true",
                    "acs": "%https.host%/store/acs",
                    "useTenantKey": false
                }
     },

That's it! Now the New key store is installed into WSO2 Enterprise Store. If in any case configurations have changed you can locate all the configuration files that have references to keystores, you can use the grep command as follows:

Open a command prompt and navigate to the <PRODUCT_HOME>/repository/conf/ directory where your product stores all configuration files.
 
Execute the following command: grep -nr ".jks" .

The configuration files and the keystore files referred to in each file will be listed. You can check what files you have not configured to point to the new key store.





How to Enable Email as Username for WSO2 Products (Email Authentication)


At present most people prefer to use their email as their username for any login since it's easy to remember the email rather than several non-email usernames. From this post my aim is to cover up how to enable email as username or email authentication for WSO2 products.

To enable Email as username/ Email authentication the following steps should be followed :

1. Enable Email Authentication in carbon.xml


You have to go to [Product_Home]/repository/conf/carbon.xml and enable the email authentication as follows :

<EnableEmailUserName>true</EnableEmailUserName>


2.Provide the Correct Regular expression to allow Email addresses for user store via the user-mgt.xml


 You can find the user-mgt.xml in [Product_Home]/repository/conf directory

<Property name="UsernameJavaRegEx">[a-zA-Z0-9@._-|//]{3,30}$</Property>

3. Create the Admin user with an Email address in user-mgt.xml


<AdminUser>
               <UserName>admin@wso2.com</UserName>
               <Password>admin</Password>
</AdminUser>


Now you can login as admin@wso2.com and create users using Email as username

The above few steps will enable Email authentication. If you want to allow both email as username and normal authentication you just have to add the following line to your user store configuration. (jdbc user store/ldap/Active directory)

<Property name="UsernameWithEmailJavaScriptRegEx">[a-zA-Z0-9@._-|//]{3,30}$</Property>

That's it!! 


Saturday, June 27, 2015

How to Create an Asset Type and attach a Life Cycle to that Asset Type for WSO2 Enterprise Store


Creating an Asset Type

By Default some asset types are added to WSO2 Enterprise Store(ES). But if you want add your own asset type here are the steps that you need to follow.

Steps :
1. You have to create a RXT definition for the asset type.
2. Add the RXT to ES, so that ES can work with that asset type.
3. Attach the created asset type with a life cycle.


Creating a RXT definition.


Here the asset type I want to add is a mobile app. So I'd be creating a RXT definition for mobile app called mobileapp.rxt

Following is the mobileapp.rxt :


In the RXT definition you can define all the fields you want to see in the UI when adding an asset from the asset type. And you can make a filed required or not or readonly or not etc from the RXT definition.

After creating the RXT definition next is to add the RXT to ES.

Add the RXT to ES

You just have to go to {ES_HOME}/repository/resources/rxts and add the created RXT definition to the directory specified.

After adding the RXT, restart the ES to see the asset type added as an asset type for ES Publisher/Store/Admin console. When you login to the ES as admin you will be able to see the created asset type Mobile App.

Attach the created asset type for a life cycle 


As soon as you add a RXT and restart, your asset type will be added a default life cycle. The life cycle has the permissions defined for asset add/update/delete operations. So if you want add a customized life cycle follow the following steps.

You can see the life cycles already added from this Path [ES_HOME]\repository\deployment\server\jaggeryapps\publisher\extensions\lifecycles

So if you want to add MobileAppLifeCycle to the asset type what you have to do is to follow these steps

1. Create a mobileapp folder in the following location :
[ES_HOME]\ repository\deployment\server\jaggeryapps\publisher\extensions\assets

2. Create an asset.js file and define the configure callback as the following :



Here I've attach the mobileapp asset tyoe to MobileAppLifeCycle. After you save the file restart the ES in-order for the changes to get effected.



The default life cycle for all the asset types are defined in [ES_HOME]\repository\deployment\server\jaggeryapps\publisher\extensions\assets\default\asset.js


Until you do the above configurations and change the asset life cycle for your created asset type, the default one will be assigned.

Saturday, June 20, 2015

How to Create an Axis2 Web Service with the Eclipse IDE

Apache defines Axis2 as a Web Service / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack. My aim is to describe how to create an Axis2 web service using eclipse IDE in windows.


Prerequisites 


  • You should have java installed and set path and Java_Home correctly (JAVA_HOME, JRE_HOME)
  • You should have Apache Tomcat and Axis2 downloaded and extracted 
  • You should have installed the Eclipse Java EE IDE 


Lets start the web service development 


First lets add Tomcat run time environment to Eclipse. Go to Window->Preferences then select Server on your left hand side. Under that you can see run time environments > click Add. You can see similar interface as Figure 1.


   Figure 1

Select Apache Tomcat v7.0 and click Next. Then you can see a similar interface as in Figure 2. Click on the Browse button and select the Apache Tomcat 7 Extracted folder. Then Click Finish


                                                                           Figure 2

Then you can see the added environment as in Figure 3.

                                                                            Figure 3

Then you need to add Axis2 path to the Eclipse preferences. Again go to Window->Preferences then click on Web Services and then select Axis2 Preferences. Then click on the Brows button and select the Extracted axis 2 folder path. (Figure 4)

                                                                         Figure 4

Step 1 : Create Dynamic web project

Click on file->New->Other and you can see an interface like Figure 5. Type Dynamic in the wizard input field and select the Dynamic Web Project. Then click Next

                                                                   Figure 5

Then add project name as you prefer. I'll put project name as SampleWebService (Figure 6) Then Change the Dynamic web module version to 2.5 and then Click on Modify button under configuration. Then select Axis2 Web Services and click OK button > Next > Finish.

                                                                            Figure 6

Step 2:  Create Web service class

Then we have to write the service class that have the method that we need to implement as a service. In my example I'll write a simple method to multiply two number which will be passed as parameters.

                                                                       Figure 7

Right click on the project you created and select New->Other. Then type service on wizards input box as figure 8 and select the web service to mark the class you created as a web service.

                                                                           Figure 8

Then You will see an interface similar to Figure 9. Give a service name as you prefer and then click on Web Service run-time: Apache Axis

                                                                       Figure 9

Then change the web server run-time to Apache axis2. Click Next and in next interface make sure to select Generate a default service.xml file option. 

Then click Next button and then in next interface you have to click Start Server button as show in Figure 10. Then Click Finish button.

                                                                              Figure 10

After you finish you can see a log similar to the following :

Figure 11

As shown in Figure 11 you can find the port your service runs. In my example it runs on 8080 port (Circled in Figure 11 ). Then you can access the web service you have just created by going to following link.
http://localhost:8080/SampleWebService/services/listServices

                                                                                  Figure 12

Click on the Service class name, you will be able to access the wsdl file.

Step 3 : Create Axis Archive file


Now we have a;ready run the web service but we haven't created the Axis Archive file from the web service that we created. To create the Axis archive go to the following path YourProjectNamePath\WebContent\WEB-INF\services\ServiceYouCreated using command line. Then enter following command.

 jar cvf FirstService.aar com META-INF

Then you can see FirstService.aar file has created on your folder location.

Now Let's deploy the Axis2.war file in to Tomcat. You should copy the Axis2.war file in to webapps folder on Apache tomcat. Then go to the bin folder on Apache tomcat installation directory from command prompt. Then run startup.bat. Please not that in this point you have to set JAVA_HOME and JRE_HOME correctly in Environment Variables.  

Then you'd be able to access the http://localhost:8080/axis2/ and you can see interface similar to Figure 13.

                                                                     Figure 13

Then Click on Administrator. Enter user name and password.(Default username is admin and password  is axis2). Click on Upload Service in Top left in your page and upload the .aar file that was created earlier.

Then go to Available service section you can see your service as Figure 14. You can click on the web service you created and access the wsdl link.,


                                                                     Figure 14

Step 4 : Create Web service Client


Then we have to create the client stub class which we can use to access the web service methods. You can right click on project then New->Other then select Web Service Client. (Figure 15)

                                                                           Figure 15

In the interface in service definition give the wsdl path (for my project it's http://localhost:8080/SampleWebService/services/FirstService?wsdl ) then click on Web Service Runtime and select Axis2. Then click next. (Figure 16)

                                                                          Figure 16

Next interface you can provide package name for the class which we are going to generate. Then click Finish 



                                                                                Figure 17

Then create a java project File->New->Other Java Project and copy the clientstub class in to that project. Then write sample test class to run the web service client.

package it.com.clientapp;
import java.rmi.RemoteException;

import org.apache.axis2.AxisFault;

import it.com.clientstub.*;
import it.com.clientstub.FirstServiceStub.MultyTwoNumber;
import it.com.clientstub.FirstServiceStub.MultyTwoNumberResponse;

public class TestWebServie {
 public static void main(String[] args) {
  try {
   FirstServiceStub stub=new FirstServiceStub();
   
   MultyTwoNumber num=new MultyTwoNumber();
   num.setNum1(10);
   num.setNum2(16.2);
   MultyTwoNumberResponse response=stub.multyTwoNumber(num);
   double returnVal=response.get_return();
   System.out.println("Client values are :"+ 10 + " x "+16.2);
   System.out.println("Server returns "+returnVal);
  } catch (AxisFault e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (RemoteException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
  
 }

}

Then right click on the class Run As -> Java Application. Then you can see this client application call the service method and returns the output.



This is a simple two number multiplication service implementation and your can implement your own service logic with different kind of parameters to the service. 

Sunday, June 14, 2015

Configuring Single Sign-on with SAML 2.0 for WSO2 Enterprise Store

Basic Overview of SAML 2.0 SSO with IS 5.0.0


My aim is to explain a simple SAML 2.0 Single Sign-on (SSO) scenario with Identity Server 5.0.0 and Enterprise Store 2.0.0. The Enterprise Store consists of a Publisher web site and a Store web site. The scenario would be to enable SSO to Publisher and Store with Identity Server 5.0.0 where IS will provide SAML2 Web browser based acting as an Identity Provider or a Service Provider.





The diagram depicts the exact use case of the above mentioned scenario where we need to enable SSO to ES publisher and store via the WSO2 Identity Server. In the above use case both the ES Publisher and ES Store are the service providers and IS is the identity provider.  

For the SSO to work, both the Publisher and Store are registered as trusted service providers in the Identity Server. Both the Publisher and Store implements the SAML 2.0 SSO and talks to the Identity Server via the assertion consumer URL defined in the publisher and store configuration files.


Step by Step approach of the visual Scenario 


1. User tries to enter to the Publisher and Store via the corresponding URLs. 
2. SAML 2.0 SSO will be configured for both the Publisher and Store as service providers in the Identity Server.
3.When the user hit the Publisher or Store URL, user will be directed to the IS login 
4. User enters the login credentials ( Note - Here both IS and ES should be pointed to one common user database/AD/ldap etc)
5.If the user exists, the login will be successful.

The Actual Configurations for SSO and How to get it Working..


Prerequisites :

Identity Server 5.0.0 (Download : http://wso2.com/products/identity-server/)
Enterprise Store (Download : http://wso2.com/products/enterprise-store/)

Configurations for both ES and IS to point to a common User database/store.


1. Create a MySQL database (e.g., 410_ustore) and run the <ES_HOME>/dbscripts/mysql.sql script on it to create the required tables.
2.Open <ES_HOME>/repository/conf/datasources/master-datasources.xml file and add the datasource configuration for the database that you use for the shared user store and user management information. For example,


3. Open <ES_HOME>/repository/conf/user-mgt.xml file and point to jdbc/ustore.
<Property name="dataSource">jdbc/ustore</Property>
Note - ES will have the the jdbc user store as the default user store. So in the same file the jdbcUserStoreManager will be uncommented. Leave it as it is.

4.Open <IS_HOME>/repository/conf/datasources/master-datasources.xml file and add the USTORE datasource that you added to ES listed above. So now both IS and ES will point to the same database.

5. Open <IS_HOME>/repository/conf/user-mgt.xml and point to jdbc/ustore
<Property name="dataSource">jdbc/ustore</Property>
Note - IS will have the ldap user store as the default user store. So you have to comment out the ldap configuration and uncomment the jdbc user store in the same file. So both ES and IS will be accessing one common user store.

6. Open <IS_HOME>/repository/conf/embedded-ldap.xml and disable the embedded ldap by setting  <Property name="enable">false</Property> within <EmbeddedLDAP> tags.


Now Both ES and IS will be pointing to one common user store..


Now Let's Register the Publisher and Store as Service Providers in IS


1. Start the IS pack
2. Go to IS Management Console > Main > Service Providers > Add
3. Give a unique name for service provider and click Register
4. Click on Inbound Authentication Configuration > SAML2 Web SSO Configuration > Configure
5. Fill on the details as follows for the publisher


Note - Assertion Consumer URL has my local/machine ip address. Configure it with your correct ip address and my ES is running on port 9444 which I have stated the offset as 1. This will be done in the future steps. 

6. Fill on the details as follows for the store


Now the Service Providers are successfully registered.

Now Let's Do the Configurations for ES to Enable SSO

Publisher Configurations

1. Open <ES_HOME>/repository/conf/carbon.xml and change the offset to 1
2. Open <ES_HOME>/repository/deployment/server/jaggeryapps/publisher/publisher.json and change the values as follows :
"sso": {
                "attributes": {
                    "issuer": "publisher",
                    "identityProviderURL": "https://10.100.7.57:9443/samlsso",
                    "keyStorePassword": "wso2carbon",
                    "identityAlias": "wso2carbon",
                    "responseSigningEnabled": "true",
                    "acs": "%https.host%/publisher/acs",
                    "keyStoreName": "/repository/resources/security/wso2carbon.jks"
                }
            }

Here the identityProviderURL will point to the IS and the issuer is given as publisher since when we were adding the service provider for the publisher we gave the issuer as publisher. Both should be the same. 
3. Open <ES_HOME>/repository/deployment/server/jaggeryapps/store/store.json and change the values as follows :
"sso": {
                "attributes": {
                    "issuer": "store",
                    "identityProviderURL": "https://10.100.7.57:9443/samlsso",
                    "keyStorePassword": "wso2carbon",
                    "identityAlias": "wso2carbon",
                    "responseSigningEnabled": "true",
                    "acs": "%https.host%/store/acs",
                    "keyStoreName": "/repository/resources/security/wso2carbon.jks"
                }
            }

Here also the identityProviderURL will point to the IS and the issuer is given as store since when we were adding the service provider for the store we gave the issuer as store. Both should be the same.

Now We are Done with the Configurations!!

Start the ES pack and Open up a Browser. Hit the Publisher URL > You should be directed to the IS login. Enter admin/admin username/password and sign in. Same with the Store.

Following is the IS login page that you will be directed to :



Hope this post is helpful. Any feedback is welcome!

Importance of Daily Scrum Meeting and Sprint Retrospective

Importance of Daily Scrum Meeting What is a Daily Scrum Meeting? A Scrum meeting is usually held for Projects that are focusing on Agi...