DEV Community

Ellis
Ellis

Posted on • Edited on

Laravel Sanctum Authentication in Vue.js SPA Application

Laravel Sanctum is another laravel official package from Laravel Framework. Until 20 March 2020, it was Laravel Airlock. Due to trademark dispute, Taylor Otwell renames it with Laravel Sanctum and confirmed it with a blog post. It's a lightweight authentication package for working on SPA (Single Page Application) or simple API. Before discovering the package, let's have a look at what Laravel Sanctum offers us.

Laravel Sanctum features

  • Simple API auth
  • Issuing API Tokens
  • Token Abilities
  • Revoking Tokens
  • SPA auth with CSRF protection
  • Authenticating Mobile Applications

Tutorial: Laravel Sanctum Authentication in Vue.js SPA Application

Top comments (1)

Collapse
 
begueradj profile image
Billal BEGUERADJ

Nice and practical explanation.
Thank you.

Billal BEGUERADJ

P.S.
Quoted from doc:

"In order to authenticate, your SPA and API must share the same top-level domain. However, they may be placed on different subdomains."