custom JiraSeraphAuthenticator class compiling issues


I am trying to implement SSO for JIRA and trying to extend JiraSeraphAuthenticator class. Here is my code

package com.siteminder.jira;

//For version 2.1.x of Confluence with UID

import javax.servlet.http.*;
import org.apache.log4j.*;

import com.atlassian.seraph.auth.*;
import com.atlassian.user.User;
import com.atlassian.spring.container.ContainerManager;
import java.util.*;
import com.atlassian.confluence.user.UserAccessor;
public class SiteMinderAuthenticator

private static final Category log;
log = Category.getInstance(SiteMinderAuthenticator.class);

public Principal getUser(HttpServletRequest request,
HttpServletResponse response)
log.debug("SMAuthenticator::getUser(HttpServletRequest request, HttpServletResponse response)");
Principal user = super.getUser(request, response);
String username = request.getHeader("SM_USER");
Cookie c[] = request.getCookies();

for(int i=0;i<c.length;i++)

Cookie ck=c[i];
if ("newuser".equals(ck.getName()))
username = ck.getValue();


log.warn("request.getHeader('sm_user'):" + username);
String password = "temp1234";
String email = request.getHeader("UI_mail");
String fullname = request.getHeader("UI_name");
if ( (user == null) && (username == null))
log.warn("No user or username");
return user;
if (user != null)
if ( (username != null) && (user.getName().compareTo(username) == 0))
return user;
log.warn("Session found; different user already logged in");
user = null;
UserAccessor userAccessor =
(UserAccessor) com.atlassian.spring.container.ContainerManager.getInstance().getContainerContext().getComponent("userAccessor");

user = userAccessor.getUser(username.toLowerCase());
if(user != null)
log.debug("Logged user in via a headers");
// Try creating new user
catch (Exception ex)
return user;

I am getting issues while compiling. I have set class path correctly. The error is

C:\ANT\com.confluence\src\ package does not exist
[javac] extends
[javac] ^
[javac] C:\ANT\com.confluence\src\ cannot find symbol
[javac] symbol : variable super
[javac] location: class com.siteminder.jira.SiteMinderAuthenticator
[javac] Principal user = super.getUser(request, response);
[javac] ^
[javac] Note: C:\ANT\com.confluence\src\ uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 2 errors

I am not sure why the compiler is not able to find this package.Any help would be greatly helpful



5 answers

How are you compiling this? With Maven? It sounds like your classpath is wrong somewhere

I am using ANT and by build.xml file looks like this

<project name="confluence" basedir="." default="main">

<property name="src.dir" value="src"/>

<property name="build.dir" value="build"/>

<property name="lib.dir" value="lib"/>

<property name="classes.dir" value="${build.dir}/classes"/>

<property name="jar.dir" value="${build.dir}/jar"/>

<property name="main-class" value="com.siteminder.confluence.SiteMinderAuthenticator"/>

<property name="login1.dir" value="C:\Program Files\Atlassian\JIRA 4.3.4\atlassian-jira\WEB-INF\lib\" />

<property name="login.dir" value="C:\Program Files\Atlassian\JIRA 4.3.4\atlassian-jira\WEB-INF\classes\com\atlassian\jira\security\login" />

<path id="classpath">

<fileset dir="${lib.dir}" includes="**/*.jar" />

<fileset dir="${lib.dir}" includes="**/*.class" />

<fileset dir="${login1.dir}" includes="**/*.jar" />

<fileset dir="${login.dir}" includes="**/*.class" />


<target name="clean">

<delete dir="${build.dir}"/>


<target name="compile">

<mkdir dir="${classes.dir}"/>

<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>


<target name="jar" depends="compile">

<mkdir dir="${jar.dir}"/>

<jar destfile="${jar.dir}/SiteMinderAuthenticator.jar" basedir="${classes.dir}">


<attribute name="Main-Class" value="${main-class}"/>




<target name="clean-build" depends="clean,jar"/>

<target name="main" depends="clean,compile"/>


When i compile with verbose option, i see that the compiler scans through all the classes within C:\Program Files\Atlassian\JIRA 4.3.4\atlassian-jira\WEB-INF\classes\com\atlassian\jira\security\login directory

Some how i am not able to make ant recognise the classpath. By the way, I am new to Java(I am .net guy). Pardon me if i am doing a silly mistake.



I'm not sure if you include all necessary classes in the classpath by using

<property name="login.dir" value="C:\Program Files\Atlassian\JIRA 4.3.4\atlassian-jira\WEB-INF\classes\com\atlassian\jira\security\login" />

Please try to shorten that to

<property name="login.dir" value="C:\Program Files\Atlassian\JIRA 4.3.4\atlassian-jira\WEB-INF\classes" />

to make sure all JIRA classes are scanned

By the way i have more fundamental questions regarding this

Is it possible to Extend JiraSeraphAuthenticator class to acheive Sitemeinder authentication?

If so, then i didn't see a correct getUser method which i can override because it has only one getuser(string username) method and not getUser(Httprequest,HttpResponse) method i am looking.

Second, Which is the simple and cleanest way of compiling jira classes? is it ANT or Marven like Colin suggested above?

Hi Shivanand,

The question regarding Siteminder would be a good candidate for a new question on AAC. Please let's first solve your compile problem here. I'd also recommend to use the Atlassian SDK to develop plugins. This SDK is Maven2 based

Best regards,


I did shorten the classpath to "C:\Program Files\Atlassian\JIRA 4.3.4\atlassian-jira\WEB-INF\classes"

It still gave me the same error. Cannot find package does not exist

Does JiraSeraphAuthenticator has a different package name? I thought its in

Any insight in to this issue would be of great help. By the way, Sincere thanks to Dieter and colin for paying attention to my questions

Sorry i could not help better. I'd recommend you to switch to get the Atlassian Plugin SDK. If the code you want to ccompile has a pom.xml the compilation using the SDK should work flawlessly if you have an internet connection (idealy without proxy since sometimes getting Maven work through a proxy can become difficult)


this page gives some help for a SiteMinder Confluence implementation:

Just as a note: We are extending com.atlassian.seraph.auth.DefaultAuthenticator for our SiteMinder SSO plugin.

Good luck,



Have you had any luck with your creating your custom authenticator to utilize Siteminder SSO?

I have been able to do this by extending JiraSeraphAuthenticator (JIRA 4.4.5), but still facing an issue that the custom authenticator is bypassing the auto-adding of first time users to the jira-users group.

I have posted a related issue:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Agile

Try the new Jira Cloud add-on for Google Sheets

Hi Atlassian community, I work on the product integration team at Atlassian and I am very excited to announce the early access program for the Jira Cloud add-on for Google Sheets. This add-on giv...

155 views 1 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you