如何laravel 4创建基于令牌的认证? [英] How to create token-based authentication in laravel 4?

查看:116
本文介绍了如何laravel 4创建基于令牌的认证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直建议使用基于令牌的认证,以确保我的Web服务,并创建另一个过滤器,验证令牌,除了权威性。我们的想法是使用AUTH过滤器登录,这是我在后台已经完成,并创造web服务新的过滤器。可能有人建议就如何做一个很好的教程,或者给我一个例子吗?

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?

推荐答案

这是我用,专为移动应用程序的Web服务:

https://github.com/lucadegasperi/oauth2-server-laravel

This is what i use, specifically for mobile app web services:
https://github.com/lucadegasperi/oauth2-server-laravel

这是OAuth2用户服务器软件包Laravel。它包含所有你需要进行身份验证,生成/验证令牌,油门,并保护您的端点。

Which is an OAuth2 server package for Laravel. It includes all you need to authenticate, generate / validate tokens, throttle, and protect your endpoints.

该规范的OAuth2有一个学习曲线,但绝对是值得的。

The OAuth2 spec has a bit of a learning curve, but is definitely worth it.

这篇关于如何laravel 4创建基于令牌的认证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆