It's all about the answers!

Ask a question

Not able to login in to RTC using ITeamRepository in RTC EClipse Client


Manjunath Badiger (3219) | asked Dec 21 '17, 12:13 a.m.
edited Dec 21 '17, 12:15 a.m.

When i tried to login in to rtc using eclipse client as shown below in the code :- 

private static String REPOSITORY_ADDRESS = System.getProperty("repositoryAddress","https://localhost:9443/ccm/");
private static String USER_AND_PASSWORD = System.getProperty("admin", "admin123");
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;
}




It is throwing me error as :- 

Unable to login: CRJAZ0124E The user name or password is invalid.

Where the username and password is coorect as i am able to login directly in the web using same username and password.

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Dec 21 '17, 5:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The way you present the code seems to indicate a lack of understanding how it works.

There is no indication in the code that the usermane and password are actually passed to the login handler in any way. If the code complains about the user name and password, that is likely the problem.

Instead of using the properties and the embedded class, maybe use something simpler that is easier to understand? Maybe visit https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ especially https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ and try to reuse an example that works?


Comments
Manjunath Badiger commented Dec 21 '17, 11:32 p.m.

Hello Ralph

I had passed the username and password to the login handler still , I am facing the same issue.


Manjunath Badiger commented Dec 21 '17, 11:33 p.m.

public static ITeamRepository login(IProgressMonitor monitor) throwsTeamRepositoryException {  ITeamRepository repository = TeamPlatform.getTeamRepositoryService().getTeamRepository(REPOSITORY_ADDRESS); repository.registerLoginHandler(new ITeamRepository.ILoginHandler() { public ILoginInfo challenge(ITeamRepository repository) {

    return new ILoginInfo() {
                    public String getUserId() {
                        return USERNAME;
                    }
                    public String getPassword() {
                        return PWD;                        
                    }
              

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.