Vue Auth / Guides / Primer

If you are new to Vue.js or web development in general, trying to get your head around authentication can be a large task. The authentication process can be difficult to understand as it covers concepts from both front and back ends. Getting into too many back-end details will not be required, but having some familiarity with them will be necessary.

The goal of this primer is to highlight some key concepts to get started in the right direction.

Knowledge

CORS

Having some familiarity with CORS will be essential. A common issue that gets reported is of requests getting rejected by the API because CORS is not setup correctly.

Sessions / Tokens

It's also good to have a general understanding of how sessions and tokens work. In particular with single page applications.

OAuth2

If the app plans to have some kind of third party authentication using a service like Facebook or Google then some basic OAuth concepts will be a must. The plugin ships with support for standard OAuth2 implementation and a couple drivers out of the box.

JSON Web Tokens (JWT)

The use of JWT has become quite popular with SPA and is worth investigating for use with simple applications. It doesn't require sessions and is quite easy to setup and understand.

Try The Demo

It's a good idea to get the demo running as a first step. It has a basic out of the box vue-cli setup with integration of common plugins such as vue-router, vue-resource and vuex.