Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Do I need to rebuild JIRA from source if I write a Seraph custom authenticator?

Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2013

I'm looking at the possibility of writing my own custom authenticator for Seraph. However, I'm not sure which way to follow.

  1. Do I need to download the JIRA source code and rebuild it?
  2. Can I just rebuild Seraph and replace existing Seraph in 'atlassian-jira/WEB-INF/lib'?
  3. How do I prepare my developer environment if I am to modify Seraph? For JIRA everything is documented here.

I'm a newbie developer.

7 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2013

No. You do not need to rebuild JIRA.

https://confluence.atlassian.com/display/DEV/Single+Sigon+Integration+with+JIRA+and+Confluence

Funny thing, I just finished one similar thing yesterday. :)

Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2013

Thanks for the answer. I read the article again carefully. Looks like I do not have to do any of those I have mentioned. As far as I understand, it's not a plug-in but I need to create it on my own and deploy it to the mentioned location. Am I correct?

Also, how do I prepare the development environment?

Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2013

Nope. It is not a plugin per se. To prepare the development environment, just download a JIRA instance and move your compiled classes over to the classpath or compile it as a JAR and move it to WEB/lib.

0 votes
dang July 22, 2013

Thanks Nic, I followed very similar steps. I added the following to pom.xml to get my code to compile:

<dependency>
<groupId>com.atlassian.crowd</groupId>
<artifactId>embedded-crowd-api</artifactId>
<version>2.6.2</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.atlassian.seraph</groupId>
<artifactId>atlassian-seraph</artifactId>
<version>2.6.0</version>
</dependency>

but still when I do a "atlas-package" I end up with a jar that has over 33,000 class files in it and is over 55mb in size. Surely this is wrong - it bundles every single dependency jar into a single file! Unpicking the jar manually seems awkward .... there must be a better solution!

0 votes
dang July 22, 2013

"It is true that a custom authenticator is not a JIRA add on. Nevertheless, you still need to rely on JIRA's authenticator."

So does this mean that I should set up the dev environment with atlas-create-plugin or another command?

And when I build the project (only a couple of small .java files), should I definitely use atlas-package ? I finally got a build to succeed, but the resultant jar ended up over 55mb in size. (Surely much too big for a small custom authenticator.)

Could you please provide a bit of detail, Timothy? A couple of minutes with a bit of specific instruction would be really helpful, as there is almost ZERO documentation about how to build Jira custom authenticators on the web.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2013

I've got a custom authenticator, although I still can't vouch that any of it is of any use to you.

It's built in the SDK, as a plugin, but we have to do a bit of hacking to make it work because of where it needs to be called and how Jira uses it.

The steps I've got documented for creating it from scratch (although the code is, of course, in source control) are:

  • atlas-create-plugin will give you an empty plugin
  • Edit the pom.xml to get the Jira version correct, but also change the version type to 1 because this authenticator needs to go in WEB-INF/lib, it's not a UPM deployable plugin
  • Put the code in over the top - specifically the java that generates the class that searph.xml will eventually point to
  • atlas-package builds the .jar for it
  • The bit I've never worked out here and end up hacking - some libraries get bound into the jar, despite the correct versions being available in the target Jira version. We open up the .jar with an archive reader and remove the extraneous files from the /lib directory in the jar. I am 100% certain that this is the wrong way to do it, and we should be telling maven to use the libraries without adding them to the .jar. But I don't know how. We do not touch any other part of the .jar
  • Copy the .jar to the Jira install's WEB-INF/lib (after backup of course) and restart it.
0 votes
dang July 22, 2013

Tried with various commands like:

atlas-create-plugin, atlas-create-jira-plugin

which all result in

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Unable to get dependency information: Unable to read local copy of metadata: Cannot read metadata from '/home/dan/.m2/repository/org/apache/velocity/velocity/maven-metadata-com.atlassian.xml': end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... @6:8)
org.apache.velocity:velocity:jar:null

Timothy, when you said "set up a new JIRA", surely you can't mean to install the runnable application? As well as install the SDK and run the atlas* command?

Would really appreciate another word or two of advice.

Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2013
Looks like something screwed up with your maven or the dependency. I would clear my maven repo and even use a new atlassain-sdk if needed.
0 votes
dang July 22, 2013

Hi Timothy, thanks for your swift response.

After reading your message again, I presume you meant something like what is described at https://developer.atlassian.com/display/DOCS/Creating+a+Plugin+Skeleton+with+the+Atlassian+SDK ...

However, I'm still unsure which of the "atlas-...." commands I'm supposed to bootstrap a Seraph authenticator project with, as it is definitely NOT a Jira plugin, nor any of the other atlas- commands I can see in the sdk/bin/ directory.

(By the way I see no way other than installing the SDK ....)

Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2013
It is true that a custom authenticator is not a JIRA add on. Nevertheless, you still need to rely on JIRA's authenticator.
0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 21, 2013

No. You do not. Setup a new JIRA add on skeleton and build your authenticator against those dependecies. Once you've run atlas-package, you can copy the class files over to the classpath. The .jar goes to WEB-INF/lib or the .class files go to WEB-INF/classes.

0 votes
dang July 21, 2013

I also have written a custom Seraph authenticator, for use with my company's Jira/SSO solution ... but I'm stuck on how to build it successfully. I am using standard Maven 3 with a minimal pom.xml, and getting many unresolved dependencies on the build attempt.

Can anybody clarify the build setup or provide a short howto on how to build a custom Seraph authenticator? ie using Maven/Ant? What do I need to download and include? Do I need to install the whole Jira SDK? (Even though the custom authenticator is not a Jira plugin)

Here's a few of the unresolved deps (about 40-50 in all) from the Maven build: opensymphony:webwork:jar:1.4-atlassian-22, webwork:pell-multipart-request:jar:1.31.0, osworkflow:osworkflow:jar:2.8.1, opensymphony:propertyset:jar:1.5 ..... etc etc

Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 21, 2013

No. You do not. Setup a new JIRA add on skeleton and build your authenticator against those dependecies. Once you've run atlas-package, you can copy the class files over to the classpath. The .jar goes to WEB-INF/lib or the .class files go to WEB-INF/classes.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events