Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Authenticating from a JIRA plugin

Subhajit Bhuiya June 26, 2018

I have written a JIRA plugin where I am getting accepting user id and password. Using those information, I want to authenticate or logged into JIRA and want subsequent  call in the same session to use the user. I am trying to use

 

String userId = req.getParameter("username");
String password = req.getParameter("password");
boolean authenticate = userManager.authenticate(userId, password);
if(authenticate){
UserProfile profile = userManager.getUserProfile(userId);
ApplicationUser applicationUser = ApplicationUsers.byKey(profile.getUserKey().toString());
authContext.setLoggedInUser(applicationUser);
applicationUser = authContext.getLoggedInUser();
}else{
resp.setStatus(500);
}

 

Is there any alternative to do login? This seems to be not working. Subsequent requests are not finding login user

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events