This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

Siteminder custom Seraph authenticator for Confluence

Overview 

Please find attached a class which can be used to integrate Confluence with Siteminder's SSO technology. I am hoping that by posting this, that someone can help do the same for JIRA (which so far I have failed miserably to do!)

The class integrates as a seraph authenticator, and its a bit clunky but it works. I am providing this as is, and if people want something quick so that they can get up and running, then this is for you. This class assumes the following:

  • Siteminder protects all resources for confluence, under the context root - for example, /confluence (the default)
  • The Siteminder agent on the server will need the following specific settings which are global for all policies on that agent
    • remove the "~" from the BadChar list
    • remove the ".css, .gif, .jpg" from the IgnoreExt (infact, you will probably leave the IgnoreExt=.fcc,.scc,.sfcc,.ccc,.ntc)
  • The class assumes the following Siteminder properties are set (via http headers)
    • cn - this will be used when creating the Full Name entity when a user is created the first time the access, for example John Doe
    • mail - this will be the mail address, for example, john.doe@person.com
    • uid - this is the user id, for example jdoe001

The class will assume you have logged into Siteminder prior to accessing Confluence. This is pretty much the standard way that Siteminder works, as it provides the standard login pages where users are automatically redirected to login and collect credentials and cookies.

Once a user has logged into Siteminder, when they access Confluence, the custom authenticator will extract there Siteminder credentials and then ( i ) try and log the user in, and if that fails, (ii) create a new user using the Siteminder credentials.

if (login(request, response, username, password, false) == true)
UserAccessor userAccessor = (UserAccessor) bucket.container
                        .ContainerManager.getInstance().getContainerContext().getComponent("userAccessor");
                    String[] defaultGroup={"confluence-users"};
                    User newUser = userAccessor.addUser(username, password, email, fullname, defaultGroup);

Limitations of the class

Each user created in Confluence is created with the same password as defined in the class. This could be randomised a little I guess (we did not do anything as a user will never be able to access Confluence using the standard access mechanisms)

The class could have better error detection/avoidance. At the moment, if the Siteminder headers are not set properly, it can lead to spurious errors in creating new users 

Limitations of the integration 

You will need to remove/change the logout references to logout of Siteminder. We actualy do not do this, as its not really required as its our enterprise SSO and so its unlikely you need to logout of Confluence.

You will need to remove the change password tabs - these are not used (NOTE! Do not do this via the External User Management or you will not be able to use groups!!)

It only works from Confluence 2.1 or later (I have tried in 2.1.x and 2.2.x )

Installation and Configuration

1. Copy the class to WEB-INF/classes/com/siteminder/confluence

2. Edit the seraph-config.xml in WEB-INF/classes and modify the authenticator from the initial

<authenticator class="com.atlassian.confluence.user.ConfluenceAuthenticator"/>

to 

<authenticator class="com.siteminder.confluence.SiteMinderAuthenticator"/>

 3. Restart the application.

  TIPS

 If this is a new installation, you must make sure that the siteminder user that you are logging in as is different you define as the admin user, otherwise, when you login for the first time, you will have no admin access.

Labels

sso sso Delete
siteminder siteminder Delete
authenticator authenticator Delete
plugin plugin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 28, 2008

    Jeremy Largman says:

    For mixed case usernames, the line below needs to be changed: if(username != nu...

    For mixed case usernames, the line below needs to be changed:

    if(username != null && user.getName().compareTo(username) == 0)

    to:

    if(username != null && user.getName().toUpperCase().compareTo(username.toUpperCase()) == 0)

    We tried SSO with different userids and it worked without any problem.

    1. Jul 21

      Ricardo Sueiras says:

      Thanks, I have uploaded a new class compiled against 2.8.2 with this patch. Hope...

      Thanks, I have uploaded a new class compiled against 2.8.2 with this patch. Hopefully it will work for 2.8.2 users - I cannot test as we dont have this version up and running yet.