OAuth or JWT? Which one to use and why?

JWT is a simple authentication protocol, Oauth is an authentication framework.

An experienced developer will take about a month to fully understand and implement Oauth. An experienced developer can pick up the JWT protocol in about a day of reading the specifications. So basically, it boils down to your specific use-case.

If you want simple stateless http authentication to an api, then JWT is just fine and relatively quick to implement, even for a novice developer.

A few JWT resources for you:

  • http://jwt.io/
  • https://auth0.com/docs
  • http://www.toptal.com/web/cookie-free-authentication-with-json-web-tokens-an-example-in-laravel-and-angularjs

And an Oauth resource:

  • http://tutorials.jenkov.com/oauth2/overview.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)