It's all about the answers!

Ask a question

Problem while getting service provider url from RTC 7.0.2 tool with authorization server


pushpita sengupta (111) | asked Mar 15 '22, 12:41 p.m.

 Downloaded this OSLC4Net build and was trying to retrieve data from RTC 7.0.2. The code is getting authenticated at client.FormLogin() and returning a OK status code. But when it is trying to fetch service provider URL based on catalog URL for the respective project area by the "client.LookupServiceProviderUrl(catalogUrl, projectArea);" it is giving the following response --


{"OSLCC004: The requested resource could not be found. "}
{StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Strict-Transport-Security: max-age=31536000
  WWW-Authenticate: Basic realm="JSA"
  WWW-Authenticate: Bearer realm="JSA"
  X-Powered-By: Servlet/3.0
  Set-Cookie: JSA_CSRF_b179c159-8dc3-4ecf-910b-0fe1c5969e5c=153579c3-8bea-44af-9d68-947497117191; Path=/ccm; Secure
  Date: Tue, 15 Mar 2022 16:28:58 GMT
  Cache-Control: no-cache="set-cookie, set-cookie2"
  Content-Length: 0
  Content-Language: en-US
  Expires: Thu, 01 Dec 1994 16:00:00 GMT
}}



Do we need to provide any other header or any other mechanism in order to fetch data from RTC 7.0.2(authorization server) via OSLC4Net? Please provide the required fix for the above problem


Comments
Ralph Schoon commented Mar 16 '22, 9:12 a.m. | edited Mar 16 '22, 9:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you ask on the OSLC Forum, consider to provide information such as 

  • the version of the OSLC client and 
  • the data provided in the call - URI, Project Area Name.
  • details such as the Java/.Net Version you used 
The expiration date is funny:
Expires: Thu, 01 Dec 1994 16:00:00 GMT

Not sure if that is to be expected, but I remember having seen cookie issues in the OSLC calls at some point related to such a phenomenon.

2 answers



permanent link
Ian Barnard (1.9k613) | answered Mar 17 '22, 5:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Mar 17 '22, 5:28 a.m.

Hi


The headers in your response indicate your client code is in fact not authenticated. Your (or OSLC4NET's?) authentication code should see the 401 and needs to follow the X-JSA-AUTHORIZATION-REDIRECT - look for that header in this doc to see what's involved https://jazz.net/wiki/bin/view/Main/NativeClientAuthentication

But questions about how this is done using OSLC4NET are unlikely to be answered here.

HTH
Ian



permanent link
David Honey (1.8k17) | answered Mar 15 '22, 9:25 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

OSLC4Net is not Jazz code - it's part of the OSLC community. So it's unlikely that Jazz developers in this forum will be able to answer questions about its code usage. The OSLC Forum might be a better place to ask. A 401 response usually means you have not authorised with the server. I do not know how OSLC4Net handles authorization.

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.