It's all about the answers!

Ask a question

Getting error oauth_problem=invalid_consumer_key when running DoorsOauthSample from https://github.com/OSLC/lyo-samples/blob/master/oslc-java-samples


Jitendra Kharche (11) | asked Aug 09 '20, 1:13 p.m.

Hi,

I am running the sample DoorsOauthSample from https://github.com/OSLC/lyo-samples/blob/master/oslc-java-samples.
I am getting following error:

<<<<<<<< HTTP response:
HTTP/1.1 401 Unauthorized
Date: Sun, 09 Aug 2020 11:34:58 GMT
WWW-Authenticate: OAuth realm="https%3A%2F%2Fjazz.net%2Fsandbox01-jts", oauth_problem="invalid_consumer_key"
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Content-Language: en-US
Content-Length: 34
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: proxy-revalidate
Connection: Keep-Alive
Set-Cookie: Node=jazzweb1|Xy/fZ; path=/
Set-Cookie: BCSI-CS-87974f0cf329b5ec=1; Path=/

oauth_problem=invalid_consumer_key
at net.oauth.client.OAuthResponseMessage.toOAuthProblemException(OAuthResponseMessage.java:83)
at net.oauth.client.OAuthClient.invoke(OAuthClient.java:308)
at net.oauth.client.OAuthClient.invoke(OAuthClient.java:262)
at net.oauth.client.OAuthClient.getRequestTokenResponse(OAuthClient.java:192)
at net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:150)
at net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:126)
at net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:106)
at org.eclipse.lyo.client.oslc.OslcOAuthClient.getResourceInternal(OslcOAuthClient.java:212)
at org.eclipse.lyo.client.oslc.OslcOAuthClient.getResource(OslcOAuthClient.java:96)
at org.eclipse.lyo.client.oslc.samples.DoorsOauthSample.main(DoorsOauthSample.java:155)

What could be the issue?
I am able to get the ServiceProviders using Postman HTTP Client.


Comments
Ralph Schoon commented Aug 10 '20, 3:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I am able to get the ServiceProviders using Postman HTTP Client.
You are able to do that using OAuth?



Jitendra Kharche commented Aug 12 '20, 1:41 p.m.

I am sorry if I was not clear in my question. 

When I run the DoorsOAuthSample I get the above exception. However if I try to access the catalog using Postman Http Client it works. My question is why it is not working through DoorsOAuthSample?
Hope I am clear now.

Be the first one to answer this question!


Register or to post your answer.