【问题标题】:Secured authentification for users Laravel 4用户 Laravel 4 的安全身份验证
【发布时间】:2014-05-25 13:38:08
【问题描述】:

我正在开发一个新的 Laravel 4 项目,我想通过 SSL 协议保护身份验证路由,老实说,我搜索了 2 天但没有运气,我不知道该怎么做。

这是我的 routes.php 文件:

Route::group(array('before' => 'guest'), function(){

/*==========================
| csrf PROTECTION
*///========================
Route::group(array('before' => 'csrf'), function(){

    /*==========================
    | Post Sign-in
    *///========================
    Route::post('/account/sign-in', array(
    'as'    => 'account-sign-in-post',
    'uses'  => 'AccountController@postSignIn'
    ));
});

/*==========================
| Get Sign-in
*///========================
Route::get('/account/sign-in', array(
'as'    => 'account-sign-in',
'uses'  => 'AccountController@getSignIn'
));

}); 

我想知道是否可以使用 wamp,或者只能使用真正的主机服务器来完成,任何帮助将不胜感激,并为我的英语不好感到抱歉。

【问题讨论】:

  • 很多谷歌点击...看起来你需要一个 HTTPS 索引。 Advanced Routing.

标签: ssl laravel laravel-4 wamp laravel-routing


【解决方案1】:

您可以使用 https 强制路由服务。例如:

Route::get('account/sign-in', array('https', function()
{
    return 'Must be over HTTPS';
}));

参考:http://laravel.com/docs/routing

【讨论】:

    猜你喜欢
    • 2013-09-11
    • 1970-01-01
    • 1970-01-01
    • 2019-01-27
    • 2014-09-07
    • 1970-01-01
    • 2013-09-09
    • 2012-04-25
    • 2012-08-24
    相关资源
    最近更新 更多