It's all about the answers!

Ask a question

Keep on getting HTTP401 when trying to access my Sanbox-RM-Project with OSLC/Lyo2


David Asher (611) | asked Feb 21 '14, 10:22 a.m.
Hi,

I just created a Sandboxproject for RequirementsManagement and tried to retrieve a Sample Requirement:

https://jazz.net/sandbox02-rm/resources/_OnKPAZr4EeOKJfCEQZYPEg

in Java using the Lyo2-Library. However, I keep on getting HTTP 401. Can you tell me please, what is the right way to authenticate?

[code]
OslcClient client = new OslcClient();
        final String USERNAME = "XXX";
        final String PASSWORD = "XXX";
        final String RM_JAZZ = "https://jazz.net/sandbox02-rm/resources/_OnKPAZr4EeOKJfCEQZYPEg";
        UsernamePasswordCredentials upc = new UsernamePasswordCredentials(USERNAME, PASSWORD);
        DefaultHttpClient httpClient = (DefaultHttpClient)client.getHttpClient();
        httpClient.getCredentialsProvider().setCredentials(AuthScope.ANY, upc);
        try {
            ClientResponse resource;
            resource = client.getResource(RM_JAZZ, MediaType.APPLICATION_XML); // <-- iS HTTP401
[/code]

thanks in advance
David

One answer



permanent link
Gabriel Ruelas (1.1k13) | answered Feb 21 '14, 10:35 a.m.
Hi,
Have you checked the Lyo code samples for RM ?  https://jazz.net/library/article/1382

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.