If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Adding Trusted Signon User to Cognos namespace Group.

Started by raviahuja21, 23 Jan 2014 05:34:31 AM

Previous topic - Next topic

raviahuja21

Hello Folks,

I am using Cognos 10.2.1.

We have created a Custom Java Authentication Provider which basically is used for Trusted Authentication.

Basically what the code does is it reads the cookie stored in the web server and creates a trusted sign on from which the user can enter into cognos.

Now so far we are going good, the user login from the third party system, hits the cognos reports URL and gets authenticated and authorized to view the report. So we are successful in implementing the trusted sign on.

Now my core requirement is that users should also have group based security wherein one user group access certain reports and the other user groups do not. Here my requirement is very simple, all users should have access to all reports but only the admin user should have access to capabilities like report studio, administration, etc. So for this I identify the user by a flag which is again stored in the cookie.

Now my goal here is to enter this user in the admin group through SDK( Java code). I somehow got this sample code from the IBM website.

http://www.ibm.com/support/docview.wss?uid=swg21335446

However this code gives me an error when I try to enter the user in the group and I noticed one strange thing though that when I configure AD as my authentication provider and try to add AD user to Cognos Group it works without any fuss. However as soon as I replace it by the Trusted Authentication it gives me error.

Is it that I cannot add my trusted authenticated user to a group via SDK or I am missing a trick here?

I was able to enter the user via backend database in the cognos content store table and the same was possible by firing an insert query in the CMREFORD1 table. but this needed a service restart.


Has anyone worked on this? Can anyone please help me on this.


public static void addToGroup(String pathOfGroup, BaseClass [] member) throws Exception
    {
        // Get the current group membership.
        PropEnum[] props = {PropEnum.defaultName,PropEnum.searchPath,PropEnum.members};
        Group group = (Group)cmService.query(new SearchPathMultipleObject(pathOfGroup), props, new Sort[]{},new QueryOptions())[0];
       
       
        if(group.getMembers().getValue() == null)
        {
               
            group.setMembers(new BaseClassArrayProp());
            group.getMembers().setValue(member);
            cmService.update(new BaseClass[]{group}, new UpdateOptions());
        }
        else
        {
            // Preserve all the existing members.
            BaseClass[] newMembers = new BaseClass[group.getMembers().getValue().length + 1];
            int index = 0;
            BaseClass obj = null;
            for(int i = 0; i < group.getMembers().getValue().length; i++)
            {
                obj = group.getMembers().getValue()[i];
                PropEnum properties[] = new PropEnum[]{
                                  PropEnum.defaultName,
                                  PropEnum.searchPath};
                BaseClass[] memberProps = cmService.query(new SearchPathMultipleObject(obj.getSearchPath().getValue()), properties, new Sort[]{},new QueryOptions());
                newMembers[index] = obj;
                index++;
            }
            newMembers[index] = member[0];

            group.setMembers(new BaseClassArrayProp());
            group.getMembers().setValue(newMembers);
            // Update the membership.
            cmService.update(new BaseClass[]{group}, new UpdateOptions());
        }
    }