Thursday, January 27, 2011

Being the way I am --- Je suis qui je suis.... :)

An elderly Chinese woman had two
large pots, each hung on the ends of a pole which she carried
across her neck...

One of the pots had a crack in
it while the other pot was perfect and always delivered
a full portion of water.

At the end of the long walks from
the stream to the house, the cracked pot arrived only half
full..

For a full two years this went
on daily, with the woman bringing home only one and a half
pots of water..

Of course, the perfect pot was
proud of its accomplishments.

But the poor cracked pot was ashamed
of its own imperfection, and miserable that it could only
do ha lf of what it had been made to do

After two years of what it perceived
to be bitter failure, it spoke to the woman one day by the
stream.

'I am ashamed of myself, because
this crack in my side causes water to leak out all the way
back to your house.'

The old woman smiled, 'Did you
notice that there are flowers on your side of the path,
but not on the other pot's side?'

'That's because I have always
known about your flaw, so I planted flower seeds on your
side of the
path, and every day while we walk
back, you water them.'

For two years I have been able
to pick these beautiful flowers to decorate the table.

Without you being just the way
you are, there would not be this beauty to
grace the house.'

Each of us has our own unique
flaw. But it's the cracks and flaws we each have that make
our lives together so very interesting and rewarding..

You've just got to take each person
for what they are and look for the good in them.

I just received the above story through an e-mail, and I just like it a lot and the moral it carries.... So I thought of sharing it in my blog too... Well.. I do not know who the original author of the above story is and if the story is being copyrighted... Being very thankful to the author, I would like to add if there is any copyright on the above story, please let me know so that I will remove it...

On a side note, I would like to mention about the topic I selected for this post... When I read  the story, it was the topic came to my mind... It is the motto of a person who also had added lot of good morals to our lives...

Saturday, January 22, 2011

Tenant management in WSO2 Carbon with a multi-tenanted embedded LDAP

You may refer to my previous blog post to get an idea what I meant by a multi-tenanted LDAP.

WSO2 stratos currently does tenant management with JDBC user store. And there is a requirement of achieving that functionality with a multi-tenanted LDAP too.

In achieving that requirement, the current solution that is there in WSO2 carbon takes a hybrid approach, where meta data related to tenants is stored in JDBC database and have the user stores of tenants in a LDAP server--which is an embedded Apache Directory Server.

Following is a high level design (as per now) related with tenant management with LDAP.


Here, apacheds-server component and apacheds orbit bundle are responsible in registering LDAPTenantManagementService (please refer the above diagram) and managing partitions in the embedded-ldap.

You can easily explore this functionality by installing multi-tenancy support on a WSO2 carbon based stand alone product. You may refer to post: Installing multi-tenancy support for WSO2 Identity Server.

In addition to the steps mentioned there, please take the following steps to connect a multi-tenanted IS to embedded ApacheDS LDAP and explore what happens in tenant management at the LDAP server's side:

Step 1: Place a file named: 'tenant-config.xml' in IS_HOME/repostory/conf directory with the following entry:


By default, it is the JDBC tenant manager that is being used and with this configuration file you can configure it to specify which tenant manager to be initialized at the initialization of the user manager.

Step 2: Start the server --> log in as admin and create few tenants as I  have described in the aforementioned post.

Step 3: Connect to the embedded-ApacheDS LDAP server through a LDAP browser like ApacheDS Studio. For that you need to:
      i. locate  user-mgt.xml file in IS_HOME/repository/conf 
     ii. obtain connection name and password to connect to the LDAP server from the browser. 

Step 4: View how separate partitions have been created for separate tenants as shown in the following image.


Few remarks:
      i. You can see the dc=cse,dc=com partition in the left panel of the above image and that is created for a tenant with the domain name: cse.com.
     ii. Inside that partition, two contexts have been created as ou=users and ou=groups to store the tenant user entries and group information.
     iii. At the creation of the partition, an entry of the tenant admin will also be created under the ou=users context. And that tenant admin can login to the system and create users for his tenant which will be stored in the particular tenant partition.

So above is one way you can manage users in LDAP in a multi-tenanted environment. But it is specific to ApacheDS and also to embedded-ApacheDS since we use ApacheDS API to manipulate storage.
We also need a solution where we can use any directory server that implements LDAP protocol to maintain the multi-tenanted user store. I will discuss about this in a future post.

Note of thanks...

I would like to make this post dedicated to thank who caused this blog a reality and motivated me for blogging.

First, it is from Prasad Sir (Prasad Samarakoon) that I got the idea of blogging. He shared the link of his blog which has a very nice collection of genuine thoughts. After visiting his blog and reading his posts, I was so inspired to start a blog of mine too. Thank you very much Sir for directing me towards blogging.

Though I started the blog with that inspiration, I could blog rarely because blogging somehow got to the last items of my to do list.

Then after completing my degree course, I came to work in WSO2 where blogging is highly encouraged and I was lucky enough to work under a leader who has a blog which is of course a great source of knowledge and  who motivates others to blog too. Thank you very much Prabath aiya (Prabath Siriwardana) for motivating me to write blogs.

Now I have given more priority to write blogs than earlier, specially on things what I learn new, hoping they would be helpful to someone, one day...