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

How to modify password by java code?

Sayeed Alam
Contributor
July 10, 2011

We have a requirement that we need to modify the password on the fly and want to update the database password field from another Application (to sync). As I can see, password is SHA1 encrypted from JIRA side. The same ways I want o encrypt the password and store into the database. Please let me know the any inbuilt JIRA API to do this job.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Sayeed Alam
Contributor
July 11, 2011

What is the name of the plugin need to be used to achive above functionility? And send me the location where I can find this plugin.

0 votes
JamieA
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 10, 2011
import com.opensymphony.user.UserManager

UserManager userManager = UserManager.getInstance()
userManager.getUser("jamie").setPassword("newpass")

Add semi-colons to suit. Probably not a great idea to maintain different stores of passwords - there will be a delay between when people change their pw and you sync them. Better to set up an LDAP server or hook into your corporate LDAP system.

Sayeed Alam
Contributor
July 10, 2011

I think, I need to set up the database connectivity by using some JIRA class to access the JIRA database from external application. Otherwise, how above code will identify the database where need to set the password. Please let me know that class name.

Sayeed Alam
Contributor
July 10, 2011

Can you tell me about the plugin and location?

JamieA
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 10, 2011

You should add the above as a comment to my answer. My answer was for if you're writing a jira plugin. I can't see a method for setting the password using the SOAP API, so you could write your own endpoint plugin module. I wouldn't try to hack the db directly.

JamieA
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 10, 2011

Could you ask more specific questions?

TAGS
AUG Leaders

Atlassian Community Events