OSLC Server for RTC

Hi everyone,

I am currently implementing my own OSLC Server that shall be used together with the IBM RTC Server.

So in my server I declared the following rootservices:

<rdf:Description rdf:about="http://localhost:8080/adaptor/rootservices">
	<dcterms:title>Root Services</dcterms:title>
	<oslc_cm:cmServiceProviders rdf:resource="http://localhost:8080/adaptor/services/catalog/singleton"/>
	<jfs:oauthRealmName>OSLC Server</jfs:oauthRealmName>
	<jfs:oauthDomain>http://localhost:8080/adaptor/services/oauth</jfs:oauthDomain>
	<jfs:oauthRequestConsumerKeyUrl rdf:resource="http://localhost:8080/adaptor/services/oauth/requestKey"/>
	<jfs:oauthApprovalModuleUrl rdf:resource="http://localhost:8080/adaptor/services/oauth/approveKey"/>
	<jfs:oauthRequestTokenUrl rdf:resource="http://localhost:8080/adaptor/services/oauth/requestToken"/>
	<jfs:oauthUserAuthorizationUrl rdf:resource="http://localhost:8080/adaptor/services/oauth/authorize"/>
	<jfs:oauthAccessTokenUrl rdf:resource="http://localhost:8080/adaptor/services/oauth/accessToken"/>
</rdf:Description>

If I want to register my server as a friend in the RTC, the RTC looks for the rootservices URL and firstly calls the oauthRequestConsumerKeyUrl and sends a name and a secret to my consumer. My server responds with a newly generated consumer key.
After that, the RTC server calls oauthApprovalModuleUrl in my server. But in this step I am not sure, what logic needs to be implemented to approve the key.
In the existing examples I couldn’t find a place where the logic of this endpoint was defined.

Can anybody help me out in the process of registering a friend in the RTC Server?

Thanks in advance.

Regards
Michael

Hello Michael,

You may find https://github.com/OSLC/lyo-samples/pull/10 by @jad useful as it has a GUI that walks you through the OAuth initialisation process.

Cheers,
Andrew

Hi @andrew,

thanks for the hint.

But I am currently having trouble with a specific problem.
I used the LyoOAuthConsumer together with a ConsumerStore in my code, but somehow the RTC still cannot create an association with my server.

The following picture shows the message, the RTC is displaying when I want to create an association:

association

Does anybody have any suggestions regarding this concrete problem?

Regards
Michael

Hi Michael,

Hard to tell from the picture. “Status 500” tells me it’s an RTC internal error, but I doubt they got it so wrong. Most likely, you server and RTC are failing in the early phases of the oauth stuff. From your original question, I wonder for example if you got the consumer key/secrete setup correctly.

tips?
I recently created this oauthClient example (which @andrew referred to https://github.com/OSLC/lyo-samples/pull/10) for exactly these reasons. It’s very messy working with oauth. Especially when working against a black-box such as RTC. So, if either client or server side is open-sourced, you can at least work out what is going on on the inside.

So, why not run this client code against your server, and see what is happening?

ps. to make this oauthClient code work, you need to work against this branch of lyo.client https://github.com/eclipse/lyo.client/pull/77, since it is still under review.

1 Like

I think Jad’s idea to try debugging your server with that tool is great as he developed it against IBM tools in the first place.

@jamsden from IBM previously developed the IOTP adaptor and detailed IBM specific auth aspects in https://oslc.github.io/developing-oslc-applications/iotp_adaptor/authentication.html There is code on Github.

Just to make sure we are not running in circles, let me link this: https://jazz.net/forum/questions/266360/oslc-server-friend-outbound

P.S. The community here is rather small so it’s unlikely you will get a ready made answer as you may expect on StackOverflow. You will have to do some digging. I would start with making sure you have logging at the TRACE level and you are providing us with the versions of the libs used (I hope you are on 2.4.0 if you are using the old client or 4.0.0-SNAPSHOT if you are using the new one Jad referred to). We will try to help you.

1 Like

@andrew @jad

Thanks for your feedback. With the sample projects i managed to get my OSLC server up and running :tada:

In addition, i found out what caused the friend registration to fail in the RTC. Besides only registering my application as a friend, I also had to add the base URL of my server to the Whitelist in the RTC.

Regards
Michael

1 Like

Glad to hear.
For future use, worth noting that the client-oauth-discovery-dui is now merged into the repository.

1 Like