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.

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

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?

OslcClient client = new OslcClient();
        final String USERNAME = "XXX";
        final String PASSWORD = "XXX";
        final String RM_JAZZ = "";
        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

thanks in advance

One answer

permanent link
Gabriel Ruelas (1.1k13) | answered Feb 21 '14, 10:35 a.m.
Have you checked the Lyo code samples for RM ?

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.