PHP code example of juhedata / cas

1. Go to this page and download the library: Download juhedata/cas library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

juhedata / cas example snippets


// cas客户端登录:重定向至服务端登录
Route::get('/api/cas/login/{mode?}', 'CasLoginController@casLogin')->name('casLogin');

// cas 登录回调:服务端登录成功后回调前端ST-校验地址
Route::get('/api/cas/oauth/ucenter', 'CasLoginController@oauthUCenter')->middleware('cas.auth');

// cas登出:客户端登出地址
Route::get('/api/cas/logout', 'CasLoginController@casLogout')->middleware('authCheck');


// cas.auth登录校验中间件
JuHeData\CasLogin\Http\Middleware\JuHeCasMiddleware

// 登录状态校验中间件:
JuHeData\CasLogin\Http\Middleware\AuthCheckMiddleware