Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
Created by: Bain McKay on 30-12-2012 02:27:10 AM I continue to have problems getting OAuth to work in the WXS 3.0 DEV Edition Procedure used 1. in My View, I click "Add Application" 2. I select "OpenSocial App" Add 3. In the URL box, I enter: http://localhost/html/gadgets/OAuthWebExSocialGadgetExample.xml * which is stored in ../opt/cisco/quad/tomcat/webapps/root/html/gadgets/ 4. I get an button with descriptive text "This gadget demonstrates performing authorization against Quad using oAuth. Click the button below to authorize access to your Quad account for the gadget." 5. I click and a two-botton box appears: "OAuth User Authorization", which contains two buttons: and . 6. I click and authorization fails, returning the following error text: 6.1 If I wait a few seconds before clicking , I get an HTML Box containing * the title ** "http://localhost/quadopen/oauth/user_auth/postlogin", and * in the box "HTTP Status 401 - Not authorized type Status report message Not authorized description This request requires HTTP authentication (Not authorized). Apache Tomcat/6.0.32" 6.1.1 I then get a [View Gadget] button, which displays the error: "Error occurred! Something went wrong: Service provider rejected request ==== Original request: GET /quadopen/api/rest/users/@me Host: localhost X-Shindig-AuthType: oauth Accept: application/json X-Forwarded-For: 0:0:0:0:0:0:0:1 X-shindig-dos: on ==== ==== Sent request 1: POST /quadopen/oauth/access_token Host: localhost X-Shindig-AuthType: none Authorization: OAuth oauth_token="bad9765f-1371-ba5a-0353-86436a644fe9", opensocial_owner_id="U-10261", opensocial_viewer_id="U-10261", opensocial_app_id="310001", opensocial_app_url="http%3A%2F%2Flocalhost%2Fhtml%2Fgadgets%2FOAuthWebExSocialGadgetExample.xml", oauth_version="1.0", oauth_timestamp="1356852673", oauth_nonce="8352642017651924103", oauth_consumer_key="f32e4320013ba3d97670fd8b05b3fefd57090641", oauth_signature_method="HMAC-SHA1", oauth_signature="%2BTzawA9M2jM2LMq18eS4rsPbecM%3D" Content-Type: application/x-www-form-urlencoded X-shindig-dos: on ==== Received response 1: HTTP/1.1 401 Connection: Keep-Alive Content-Length: 27 Content-Type: application/x-www-form-urlencoded;charset=UTF-8 Date: Sun, 30 Dec 2012 07:31:13 GMT Keep-Alive: timeout=300, max=4000 Server: Apache WWW-Authenticate: OAuth realm="http%3A%2F%2Flocalhost", oauth_problem="token_expired" oauth_problem=token_expired ====" 6.2 If I click immediately (rather than waiting as above), I get the error message in 6.1.1 only. === I have had this work, but it is inconsistent at best. I've been trying to work through adding Gadgets which call the Pop-up authorization for 3 days now. I'ts probably work 5% or the time at best.
At one point I could no longer add Gadgets or Remove them at all, so I restored the VM from the initial snapshot and started from a clean machine. From the clean machine I can once again add Gadgets as long as i don't have to Authenticate them. TESTING WITH FIREFOX RESTAPI PLUGIN
When I use the FireFox RestAPI plugin to work through the Authentication screens, I am able to get the first two steps to work, but step three fails on invalid syntax. This perhaps provide a hint as to what I am doing wrong, or what is wrong with my environment. Here is the RestAPI API authentication procedure I am using: 1. Register an API consumer: Method: POST usl: http://localhost/api/quad/rest/management/apiconsumers Content-type: application/json Accept: application/json Authorization: Basic signature inserted from the | drop-down menu { "description": "Kayvium", "name":"Kayvium", "callbackUrl": "http://localhost/quadopen/gadgets/oauthcallback" } click I get the following JSon model in Response preview: { "statusCode": 200, "startIndex": 0, "itemsPerPage": 1, "totalResults": 1, "filtered": false, "sorted": false, "entry": [ { "data": { "accessPermission": "", "author": "10261", "callbackUrl": "http://localhost/quadopen/gadgets/oauthcallback", "consumerKey": "25db1f51fe26b8cbe84ce24f824a92e39ccf3483", "consumerSecret": "3395615d305d016d2f9df7aed0749dcc9f1cd451", "createDate": 1356854032797, "description": "Kayvium", "id": 410038, "modifiedDate": 1356854032797, "name": "Kayvium", "resource": "http://quad.cisco.com/schema/1.0/apiconsumer", "state": "active", "type": null } } ], "serverMessages": null } 2. To get the request token, I leave the Method as "POST" and enter url = http://localhost/quadopen/oauth/request_token 2.1 Then I click | An OAuth pop-up is displayed with the Consumer Key and Secret. I leave Access Token and Access Token Secret blank and click 2.2 Another pop-up asks if I want to refresh OAuth signature. It makes no difference to the results if I refresh or not. The Authorization Header now contains the following: OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="UN96DrC3gieJ1AF", oauth_timestamp="1356854229", oauth_consumer_key="f32e4320013ba3d97670fd8b05b3fefd57090641", oauth_signature="4AfVvI0blRtKutu5Aq6kgjQa0gM%3D" 2.3 I click 2.3.1 The Response Header contains "Status Code: 200 OK" 2.3.2 The Response Body (raw) contains oauth_token=a6c6fda9-2303-a570-3260-b7e1a7204eb0&oauth_token_secret=342dd4e6bd94dc36a0c110c3ee6aeca9311a0ad8&oauth_callback_confirmed=true&xoauth_user_auth_url=http%3A%2F%2Flocalhost%2Fquadopen%2Foauth%2Fuser_auth%2F%3Foauth_token%3Da6c6fda9-2303-a570-3260-b7e1a7204eb0 . 3. Next, I change the Method to GET and enter url (with Signature as the Token) to: http://localhost/quadopen/oauth/user_auth?oauth_token=<oauth_token 4AfVvI0blRtKutu5Aq6kgjQa0gM%3D> 3.1. I click and get "Status Code: 400 Bad Request" HTTP Status 400 - Authentication token not found type Status report message Authentication token not found description The request sent by the client was syntactically incorrect (Authentication token not found). Apache Tomcat/6.0.32 4. I don't get to the final step, to get an access token and access token secret: http://localhost/quadopen/oauth/access_token?oauth_verifier=<verifier from #3> In step 3, there is no other token to add other than the Signature Token. I cannot see the syntax error, but perhaps I've been looking at this too long. Any help or guidance would be appreciated. I have run out of options.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: