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?
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:
Does anybody have any suggestions regarding this concrete problem?
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?
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.
Thanks for your feedback. With the sample projects i managed to get my OSLC server up and running
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.