richard
richard

Reputation: 1585

Token authorisation for Laravel 5 RESTful API

I'm writing a RESTful API using Laravel 5. Out of the box, Laravel 5 provides a number of middleware services for authentication, etc.

I'm implementing a token-based authentication system for a RESTful API. My question is whether or not I should modify the existing Laravel 5 files or whether I should just ignore them and create my own middleware.

I know either would work but I'm more wondering about best practice particularly in the light of upgrading down the track as it always makes me a little nervous modifying the original code files in a framework. My normal expectation would be that a framework is kept in a separate folder from my application so that its clear which files can be safely modified with minimal effect on the upgrade path.

Upvotes: 2

Views: 347

Answers (2)

Akshay Khale
Akshay Khale

Reputation: 8361

You can refer How to create Token-Based authentication in laravel 4?

There the answer includes link to a OAuth2-Server-Laravel which helps you to implement OAuth2 Token based Verification of requests for create Restful Api.

For documentation of OAuth2-Server0Laravel refer this link.

Upvotes: 0

bjoops
bjoops

Reputation: 11

Not a direct answer to your question, and I have no personal experience with it, but if you hadn't seen it this may be what you're looking for: https://github.com/susomena/Laravel-Token-Auth

Upvotes: 1

Related Questions