Closed VGraupera closed 11 years ago
This isn't supported in Maglev right now. I know it is in @iwarshak's AFMotion branch (https://github.com/iwarshak/maglev/tree/afmotion) via AFMotion support, but nothing here yet.
Can't you just set the credentials in the default_url_options
like so?
Maglev::API.default_url_options = { credentials: { username: "foo", password: "bar" } }
You could, but then your credentials are sent as url params, and not encrypted
Hi,
How do you set authentication in Maglev::API.setup? I cant find an example and i've tried a few combinations without success.
In BW, it would be something like
BW::HTTP.get("http://mysite.com/resource", {credentials: {username: 'john', password: 'API'}}) do |response| p response.body.to_str # prints the response's body end
but I dont see how to pass these credentials into Maglev::API.setup.
Thanks.