how to authenticate RESTful API in Laravel 5?

不羁的心 提交于 2019-12-01 02:12:43

I was looking for the same answer and I found this link very useful with detailed information and usage for L5 with the use of JWT .

JSON Web Token

Hope it helps you too.

The Concept to use here would be Middleware: To get you started, put this in your API-Controller's ctors:

public function __construct()
{
    // reqires Authentificataion before access
    $this->middleware('auth.basic');
}

Your app should then be able to call the resources like

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