Laravel Sanctum provides a featherweight authentication system for SPAs (single-page applications), mobile applications, and simple, token-based APIs. Sanctum allows each user of your application to generate multiple API tokens for their account. These tokens may be granted abilities/scopes that specify which actions the tokens are allowed to perform. Laravel Sanctum exists to solve two separate problems. Let's discuss each before digging deeper into the library. First, Sanctum is a simple package you may use to issue API tokens to your users without the complication of OAuth. This feature is inspired by GitHub and other applications that issue "personal access tokens". For example, imagine the "account settings" of your application has a screen where a user may generate an API token for their account. You may use Sanctum to generate and manage those tokens. These tokens typically have a very long expiration time (years), but may be manually revoked by the user anytime.

Features

  • SPA Authentication
  • Sanctum does not use tokens of any kind
  • Sanctum uses Laravel's built-in cookie based session authentication services
  • Sanctum will only attempt to authenticate using cookies when the incoming request originates from your own SPA frontend
  • Override Default Models
  • Documentation available
  • Examples available

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow Laravel Sanctum

Laravel Sanctum Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Laravel Sanctum!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Frameworks

Registered

2024-04-05