mgomes / api_auth

HMAC authentication for Rails and HTTP Clients
MIT License
480 stars 147 forks source link

Document for faraday client #124

Open leomao10 opened 8 years ago

leomao10 commented 8 years ago

Hi There, I could not find any document for api-auth faraday client.

Is there any example code other than spec

leomao10 commented 8 years ago

So far, this is how I make it work:

connection = Faraday.new(url: host)
connection.get url, params do |request|
  ApiAuth.sign!(request, access_id, secret_key, digest: 'sha256')
end

However, I need to add ApiAuth.sign! for every Faraday request. And such logic should be abstract as a Faraday middleware.

Wondering if it is possible to do it.

leomao10 commented 7 years ago

Hey @mgomes,

Sorry to @ you directly, just wondering if ApiAuth support Faraday middleware at the moment, as for middleware, what I get is request_env, not request object from Faraday

zamith commented 7 years ago

@leomao10 when you call authentic? does it return true? I've been doing exactly the same from the client perspective, but on the server authentic? is always false.

punitcse commented 5 years ago

@leomao10 @zamith I am also facing the same issue but with 2.1.0 version of the gem. Please let me know if I should create a new issue for the same. cc: @mgomes