Polarion OSLC consumer implementation

Hi Michael, Jad,

I am writing an OSLC java client for Polarion.
I have too started with ‘DoorsOauthSample.java’ as base.

Now I am stuck exactly where Michael is stuck:

Enter this URL in a browser and run again: http://eis-alm-appserv/polarion/oslc/services/oauth/authorize?oauth_token=3175de4f-d95f-4241-b9f0-2087d6013779

Let me explain:
These are the OAUTH URLS from Polarion rootservices.

<jfs:oauthRequestConsumerKeyUrl rdf:resource="http://eis-alm-appserv/polarion/oslc/services/oauth/requestKey"/>
<jfs:oauthApprovalModuleUrl rdf:resource="http://eis-alm-appserv/polarion/oslc/services/oauth/approveKey"/>
<jfs:oauthRequestTokenUrl rdf:resource="http://eis-alm-appserv/polarion/oslc/services/oauth/requestToken"/>
<jfs:oauthUserAuthorizationUrl rdf:resource="http://eis-alm-appserv/polarion/oslc/services/oauth/authorize"/>
<jfs:oauthAccessTokenUrl rdf:resource="http://eis-alm-appserv/polarion/oslc/services/oauth/accessToken"/>
  1. First request the consumer key by requestKey URL
  2. Then goto approveKey URL in browser which open Polarion UI to approve the generated consumer key.
  3. Then, try to get catalog or any other resource from OslcOAuthClient OR even via Postman, it first need to have valid access token. Hence it goes to requestToken URL which returns oauth_token and oauth_token_secret.
  4. Now OslcOAuthClient calls the fourth URL which is authorize which returns an HTML page; hence if fired via java or postman, gives error that is mentioned above.

How to get it authorized via code to access the resources further?
The OslcOAuthClient never goes past authorize step.

FYI, Polarion 19 supports creationFactory fully, but thats for later. I need to get past this OAuth accesstoken issue.

Regards,
Ankur

1 Like