Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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

0 votes



One answer

Permanent link
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.

1 vote

Comments

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926
× 411
× 169

Question asked: Apr 09 '14, 11:13 a.m.

Question was seen: 7,568 times

Last updated: Apr 10 '14, 10:42 a.m.

Confirmation Cancel Confirm