How to limit username account naming for a specific local user directory in Jira?

I have a public Jira instance that allows people to register to create new accounts, but the same instance is used by internal people that are using LDAP to authenticate.

The main problem is how to prevent people from outside from creating accounts with the same name as ones from intranet?

3 answers

1 accepted

0 votes
Accepted answer
Here is a client-side restriction that works if you add this code to the Annoucement Banner in admin pannel.
Still rememeber that this is only client side, so people can go around this if they really want.
<script type="text/javascript">

if(typeof jQuery == 'undefined'){
        document.write('<script type="text/javascript" src=""></'+'script>');

jQuery('#signup').submit(function(e) {
   username = escape(document.getElementById("signup-username").value);
   if (! /^[a-zA-Z0-9]+\.[a-zA-Z0-9]+$/.test(username)) {
   alert("Your username is not acceptable.\n\nYou must use 'firstname.lastname' pattern when you create your username.\n\nYou must have a dot inside your username.");



Hi, I can't think of any out-of-the-box way to handle it, but you can edit the registration page with some javascript.

Use the JIRA REST API to search for users with the username used to register and reject if a result returns from the REST search. Does this work for you?

It doesn't work because corporate accounts can be created at any time. All I am looking for is to force a specific pattern (regexp) for creation of local accounts.

Hi, you can add the regexp via javascript just as well. Are you looking for a plugin or an existing solution instead? We haven't had to do this just yet.

1st JavaScript is client side so there is no guarantee that people will not get around this, but probably I could leave with this problem. 2nd, which is more important: I don't want to modify Jira core files because the changes will be lost at each upgrade, which is quite often.

A plugin will probably do.

1 vote
Ruchi Tandon Atlassian Team Sep 04, 2012

Hey Sorin,

I would support the option of

"force a specific pattern (regexp) for creation of local accounts."

You can use Javascript code on top of JIRA to achieve this. This would make sure that the usernames are never the same.

The other option with the email addresses

"even better allow, people to login using their email address (email as login). I know that this could be a problem if you have several accounts with the same email, something that currently is possible in Jira, even if I wish not to be possible."

seems prone to errors, so I would not recommend it.

In addition to above options, you could write a plugin in order to achieve this. If your team does not have the expertise to implement this, you could contact one of our Experts who are professionals in implementing requirements like these.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,465 views 15 19
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