How to create token-based authentication in laravel 4?

点点圈 提交于 2019-12-13 00:12:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!