playframework / playframework/play-ws

WS/OAuth calls signed with OAuthCalculator not being properly signed & therefore rejected

Open
#155 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:backlog
Dominant language
Scala
Stars
224
Forks
92
Avg merge
1d 19h
Merged PRs (30d)
28

Description

Moved from https://github.com/playframework/playframework/issues/6251

Play Version

2.5.3 (but also not working in 2.4.2)

API

Scala

Operating System

Windows 10 (also tested on MacOSX & CentOS Linux)

JDK

Oracle 1.8.0_77

Library Dependencies

N/A

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. We extended the code example found here for OAuth 1.0a: https://www.playframework.com/documentation/2.5.x/ScalaOAuth
  2. The first part, using the consumer key & secret to get an access token & secret works without issue.
  3. The second part, signing a WS request using OAuthCalculator fails.
Actual Behavior

We have tested with both Twitter & Intuit Quickbooks Online.

  1. As outlined before, we are able to get a valid access token & secret. We know this because it works when we use the token/secret obtained from out Play app making an API call on https://www.hurl.it/ and other OAuth 1.0a testing tools.
  2. The part that fails is the actual WS.url("url").sign(OAuthCalculator(KEY, credentials)).get, it seams the
Reproducible Test Case

Source code example here: https://github.com/ChickenSniper/Play-OAuth1a-Tset

To test against Twitter...run route /authQBO. The API response is
{"errors":[{"code":89,"message":"Invalid or expired token."}]}
although the token was just generated!

To test against Intuit Quickbooks Online...run route /authTwitter. The API response is

OAuth Token rejected
270
2016-06-17T16:40:06.0266294Z

although the token was just generated!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproducible test case and the WS.url("url").sign(OAuthCalculator(KEY, credentials)).get entry point described in the issue. Trace the OAuthCalculator signing request and compare it with the OAuth 1.0a requests accepted by Twitter and Intuit QuickBooks Online. Done means freshly generated access tokens produce accepted signed requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.