As you know, actual tasks/activities in Stardust are performed by users. These can be created in the Stardust using Admin perspective or Stardust can pull in the users from existing user repository like Exchange Server or any user store.

To achieve second option above, Stardust provides call back mechanism where we can provide our custom implementation to link users and credentials from existing system to Stardust roles and organizations.

This process is called as user synchronization. It has three parts. First is, authenticating users from external user registry. Second part is, synchronizing users along with their properties. And third is authorization of the users from external user repository. Even, there is forth part, applying a suitable strategy of when and how frequently users should be synced into Stardust. We will discuss this forth element in a separate article.

For Stardust, it doesn’t matter from which or what types of external user repository users are authenticated. The logic/code to pull users from external repo various, but once user data is fetched, how it is supplied to the Stardust engine remains constant.

In this article, to make our learning easier, we will use simple in-memory user store.

This article assumes that reader is already familiar with modeling basics and how user management and role assignment works in Stardust.

Authenticating the User

Once we have decide that we are going to use external user store (existing system) for user management, at Stardust end, all we need to do is write couple of call back classes and hook them into the Stardust.

To authenticate users, all we need to do is, implement a Stardust interface, ExteranlLogingProvider, which has only one method called login. And then, plug this class into the Stardust (as shown below), and that’s it. The stardust will start to delegate the authentication to this class.

For simplicity reason, we have implemented this interface as part of our user store class. See above.

Synchronizing User Details

Synchronizing User Grants

Hook in Our Code

To plug in our code in the Stardust, all we need to do is add the following entries in the carnot.perperties file.