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

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="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></'+'script>');
  }

jQuery(function(){
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.");
   stopEvent(e);

  }   
});
});

</script>

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.

Regards,

Ruchi

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

232 views 1 18
Join discussion

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