2020-05-05 07:06:19 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use App\Services\Saml;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
2021-06-10 13:15:52 -07:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2020-05-05 07:06:19 -07:00
|
|
|
|
|
|
|
class SamlServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
$this->app->singleton(Saml::class, Saml::class);
|
|
|
|
|
|
|
|
Route::group(['namespace'=> 'App\Http\Controllers'], function () {
|
|
|
|
Route::group(['prefix'=> 'saml'], function () {
|
|
|
|
Route::get(
|
|
|
|
'metadata',
|
|
|
|
[
|
|
|
|
'as' => 'saml.metadata',
|
2021-06-10 13:15:52 -07:00
|
|
|
'uses' => 'Auth\SamlController@metadata', ]
|
2020-05-05 07:06:19 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
Route::match(
|
|
|
|
['get', 'post'],
|
|
|
|
'acs',
|
|
|
|
[
|
|
|
|
'as' => 'saml.acs',
|
2021-06-10 13:15:52 -07:00
|
|
|
'uses' => 'Auth\SamlController@acs', ]
|
2020-05-05 07:06:19 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'sls',
|
|
|
|
[
|
|
|
|
'as' => 'saml.sls',
|
2021-06-10 13:15:52 -07:00
|
|
|
'uses' => 'Auth\SamlController@sls', ]
|
2020-05-05 07:06:19 -07:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'login/saml',
|
|
|
|
[
|
|
|
|
'as' => 'saml.login',
|
2021-06-10 13:15:52 -07:00
|
|
|
'uses' => 'Auth\SamlController@login', ]
|
2020-05-05 07:06:19 -07:00
|
|
|
);
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['prefix' => 'admin', 'middleware' => ['web', 'auth', 'authorize:superuser']], function () {
|
|
|
|
Route::get('saml', ['as' => 'settings.saml.index', 'uses' => 'SettingsController@getSamlSettings']);
|
|
|
|
Route::post('saml', ['as' => 'settings.saml.save', 'uses' => 'SettingsController@postSamlSettings']);
|
2020-05-05 07:06:19 -07:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|