-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From PR feedback, use routeParam to get the idpName. Removes need for hardcoded list of routes built by for-loop, and in controller ctor, removes need for (awkward) request path parsing. Instead, just abort(404) if the `$idpName` is not in the configured list Tested, works with and without routesPrefix defined.
- Loading branch information
1 parent
ccaf8f3
commit 87065d3
Showing
4 changed files
with
18 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
<?php | ||
|
||
foreach (config('saml2_settings.idpNames') as $key => $value) { | ||
|
||
Route::group([ | ||
'prefix' => config('saml2_settings.routesPrefix').'/'.$value, | ||
'middleware' => config('saml2_settings.routesMiddleware'), | ||
], function () use ($value) { | ||
|
||
Route::middleware(config('saml2_settings.routesMiddleware')) | ||
->prefix(config('saml2_settings.routesPrefix').'/')->group(function() { | ||
Route::prefix('{idpName}')->group(function() { | ||
Route::get('/logout', array( | ||
'as' => $value.'_logout', | ||
'as' => 'saml2_logout', | ||
'uses' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller@logout', | ||
)); | ||
|
||
Route::get('/login', array( | ||
'as' => $value.'_login', | ||
'as' => 'saml2_login', | ||
'uses' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller@login', | ||
)); | ||
|
||
Route::get('/metadata', array( | ||
'as' => $value.'_metadata', | ||
'as' => 'saml2_metadata', | ||
'uses' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller@metadata', | ||
)); | ||
|
||
Route::post('/acs', array( | ||
'as' => $value.'_acs', | ||
'as' => 'saml2_acs', | ||
'uses' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller@acs', | ||
)); | ||
|
||
Route::get('/sls', array( | ||
'as' => $value.'_sls', | ||
'as' => 'saml2_sls', | ||
'uses' => 'Aacotroneo\Saml2\Http\Controllers\Saml2Controller@sls', | ||
)); | ||
}); | ||
|
||
} | ||
}); |