Giter Club home page Giter Club logo

ohhauth's People

Contributors

mw99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ohhauth's Issues

Request with OAuth Query parameters

My OAuth request works only if I use the below method in Postman (Request body/Request URL). Postman adds the OAuth parameters as query parameters. I this currently supported, i cannot find it in the code.

image

Thanks

cannot hit oauth/request_token endpoint

I am attempting to use OhhAuth to calculate signatures with the Vapor server-side library. It's working pretty well, for example here where I'm doing a simple username search:

let path = URL(string:"https://api.twitter.com/1.1/users/search.json"),
var headers = HTTPHeaders()
var signature = OhhAuth.calculateSignature(
    url: path, 
    method: "GET", 
    parameter: ["q" : keywords], 
    consumerCredentials: self.consumerCredentials, 
    userCredentials: self.userCredentials
    )
headers.replaceOrAdd(name: .authorization, value: signature)
_ = try container.client().get("\(path)?q=\(escapedKeywords)", headers: headers).map { response -> Void in
  // hooray

The process for getting a request_token, as far as I can tell, has two differences: userCredentials is nil (we're trying to get them), the parameter is a percent-escaped callback, and the signature has an oauth_callback parameter in there. (and it's POST instead of GET, nabd)

I've tried many variations on this request and always get "unauthorized" from Twitter. Am I overlooking something stupid?

var signature = OhhAuth.calculateSignature(
    url: path,
    method: "POST",
    parameter: ["oauth_callback": "http%3A%2F%2Flocalhost%3A3000%2Fcallback%2Ftwitter"],
    consumerCredentials: self.consumerCredentials,
    userCredentials: nil
)
signature = signature + ",oauth_callback=\"http%3A%2F%2Flocalhost%3A3000%2Fcallback%2Ftwitter\""

Internal method

Hello @mw99.

Since the update to Swift 5 some methods provided by OhhAuth API are not available anymore, because they are defined as internal.

let authenticationHeader = OhhAuth.calculateSignature(
    url: url,
    method: "POST",
    parameter: queryParams,
    consumerCredentials: credentials.consumer,
    userCredentials: credentials.user
)

Cannot access calculateSignature(url: URL, method: String, parameter: [String: String], consumerCredentials: Credentials, userCredentials: Credentials?) -> String: It is internal in OhhAuth

I believe this must be a mistake. See this.

Verification of signature fails when converting request tokens to access tokens

Hello,
When converting request tokens to access tokens, the api returns the error:

Auth Verification Failed: Verification of signature failed (signature base string was "GET&https%3A%2F%2Fapi.schoology.com%2Fv1%2Foauth%2Frequest_token&oauth_consumer_key%3D7c270332678c7a6b89071cd10710e9a005b90a3e0%26oauth_nonce%3D92ED8369-77FD-4E12-9166-B8B465FC0F5E%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1536906489%26oauth_token%3D98bb7e85be4900e7a0586baf5d68469105b9b54f4%26oauth_verifier%3Duivwguidsvgosdiuvgo%26oauth_version%3D1.0").

Could you look into the signature generating method when there are tokens present?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.