We're updating the issue view to help you get more done. 

Authentication fails when username contains domain name

Description

Authentication fails when username contains domain name;
e.g. DOMAIN\z12345

Test connection results in:
Failed to connect to server "JIRA Server"

Login failed

Atlassian.plvs.api.LoginException

com.atlassian.jira.rpc.exception.RemoteAuthenticationException: Invalid username or password.

System.Web.Services.Protocols.SoapException

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Atlassian.plvs.Atlassian.plvs.api.soap.service.JiraSoapServiceService.login(String in0, String in1)
at Atlassian.plvs.api.jira.soap.SoapSession.login(String userName, String password)

at Atlassian.plvs.api.jira.soap.SoapSession.login(String userName, String password)
at Atlassian.plvs.api.jira.JiraServerFacade.login(JiraServer server)
at Atlassian.plvs.dialogs.jira.TestJiraConnection.testConnection()

I suspect the root cause in:
https://studio.atlassian.com/svn/PLVS/trunk/plvs/plvs/api/jira/soap/SoapSession.cs

public string login(string userName, string password) {
try {
service.Credentials = new NetworkCredential(CredentialUtils.getUserNameWithoutDomain(userName), password, CredentialUtils.getUserDomain(userName));
Token = service.login(CredentialUtils.getUserNameWithoutDomain(userName), password);
return Token;
} catch (Exception e) {
throw new LoginException(e);
}
}

...getUserNameWithoutDomain always removes the domainn from the username, so it ends up in an invalid username exception.

any possibility to fix this?

Environment

None

Testing Notes

None

Status

Assignee

Janusz Gorycki

Reporter

Christoph Weinlich

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Components

Fix versions

Affects versions

1.3.6

Priority

Major