News for hackers. Stuff that matters.
Re:API Design Guide by amingilani on Wednesday February 22, 2017 @01:01PM (#13707537)
My biggest pain when designing a rest API is a standard authentication method that won't drive me crazy. So far i've always used 3rd party modules to implement different kinds of authentication but I never quite understood it in depth.

Apart from HTTP Basic Auth, but please don't use that.

Re:API Design Guide by johnjuuljensen on Wednesday February 22, 2017 @02:21PM (#13708358)
Basic auth is great. It lowers the barrier of entry, to anyone with a browser. Not all users of APIs are developers.
Re:API Design Guide by fixermark on Wednesday February 22, 2017 @03:39PM (#13708949)
https basic auth, I assume you mean.

For http basic auth, you may as well just "secure" the resource by hosting it at http://my-username-and-password.example.com or http://example.com/username/password/resource

Re:API Design Guide by johnjuuljensen on Wednesday February 22, 2017 @03:49PM (#13709010)
I thought https was implied these days :)

Yes absolutely https.

Re:API Design Guide by camus2 on Wednesday February 22, 2017 @01:09PM (#13707620)
> Apart from HTTP Basic Auth, but please don't use that.

What's wrong with basic auth with HTTPS? You can delegate authentication with OAUTH and then use OAUTH for authorization but authentication still has to be done somewhere.

Re:API Design Guide by zeveb on Wednesday February 22, 2017 @03:36PM (#13708922)
> What's wrong with basic auth with HTTPS?

The only thing wrong that I can see is that it's 2017 and the browsers still don't have a good (indeed, AFAIK, any) UI for logging out.

Re:API Design Guide by nandhp on Wednesday February 22, 2017 @10:07PM (#13711315)
Or for staying logged in across sessions (or not). But it should be fine for an API.
Re:API Design Guide by avenoir on Wednesday February 22, 2017 @01:19PM (#13707706)
I think Twillio API still uses or used basic auth via HTTPS.
Re:API Design Guide by tomschlick on Wednesday February 22, 2017 @05:03PM (#13709630)
So does Stripe. There is nothing wrong with basic auth for api tokens so long as you're using HTTPS.