It's all about the answers!

Ask a question

Is it possible to login to ITeamRepository using an existing stored alias?


Andy Jewell (24236374) | asked Apr 09 '14, 11:13 a.m.
In my custom scripts I have been logging onto RTC using the generic login code posted in the blogs and forums:

public static ITeamRepository login(final String rtcuser,final String rtcpasswd,String repoURL)
throws TeamRepositoryException {
monitor = new SysoutProgressMonitor();
ITeamRepository repository = TeamPlatform.getTeamRepositoryService()
.getTeamRepository(repoURL);
repository.registerLoginHandler(new ITeamRepository.ILoginHandler() {
public ILoginInfo challenge(ITeamRepository repository) {
return new ILoginInfo() {
public String getUserId() {
return rtcuser;
}
public String getPassword() {
return rtcpasswd;
}
};
}
});
monitor.subTask("Contacting " + repository.getRepositoryURI() + "...");
repository.login(monitor);
monitor.subTask("Connected.");
return repository;
}

Does anyone have an example of using an existing client alias to obtain a connection?  I am writing a script now where I do some things through lscm (commandline) and other things through a custom library.  I would like to use the stored alias so that I don't need to collect the login credentials from the user.  ITeamRepository.addAliasRepositoryURI seems like it may be referring to a file URI but I'm not sure if that's true, or if it is, how I would use it.

Any ideas?


Andy

One answer



permanent link
Shashikant Padur (4.3k27) | answered Apr 10 '14, 12:34 a.m.
JAZZ DEVELOPER
edited Apr 10 '14, 12:34 a.m.
Andy,
Are you saying you want to use the info from the repositories.txt file? You may be able to read the repository uri and username but not the encrypted password which is specific to the command line.

Comments
Andy Jewell commented Apr 10 '14, 10:42 a.m.

My thought was not to read it, per se, but to use it directly as a means to authenticate.  It sounds like from the API perspective, there are no cached credentials.  Thanks, Shashikant! 

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.