问题
I've been suggested to use token-based authentication, in order to secure my webservices, and to create another filter that verifies tokens, apart from auth. The idea is to use the auth filter for log-in, which I have already done in the backend, and to create a new filter for webservices. Could someone recommend a good tutorial on how to do this, or give me an example?
回答1:
This is what i use, specifically for mobile app web services:
https://github.com/lucadegasperi/oauth2-server-laravel
Which is an OAuth2 server package for Laravel. It includes all you need to authenticate, generate / validate tokens, throttle, and protect your endpoints.
The OAuth2 spec has a bit of a learning curve, but is definitely worth it.
来源:https://stackoverflow.com/questions/25407788/how-to-create-token-based-authentication-in-laravel-4