|
@@ -15,26 +15,26 @@ discard block |
|
|
block discarded – undo |
|
15
|
15
|
{ |
|
16
|
16
|
// Make sure nobody is including or running this thing without all the required env settings |
|
17
|
17
|
foreach (config('enterpriseauth.credentials') as $config => $env) { |
|
18
|
|
- if (! config('enterpriseauth.credentials.'.$config)) { |
|
|
18
|
+ if (!config('enterpriseauth.credentials.'.$config)) { |
|
19
|
19
|
throw new \Exception('enterpriseauth setup error: missing mandatory config value for enterpriseauth.credentials.'.$config.' check your .env file!'); |
|
20
|
20
|
} |
|
21
|
21
|
} |
|
22
|
22
|
|
|
23
|
23
|
// Actually I have my own oauth token cache based authentication guard now lol |
|
24
|
24
|
config(['auth.guards.api.driver' => 'oauthtoken']); |
|
25
|
|
- Auth::extend('oauthtoken', function ($app, $name, array $config) { |
|
|
25
|
+ Auth::extend('oauthtoken', function($app, $name, array $config) { |
|
26
|
26
|
return new \Metaclassing\EnterpriseAuth\Middleware\OauthTokenGuard(Auth::createUserProvider($config['provider']), $app->make('request')); |
|
27
|
27
|
}); |
|
28
|
28
|
|
|
29
|
29
|
// Make sure that this vendor dir and the routes dir are in any scanned paths for swagger documentation |
|
30
|
30
|
$swaggerScanPaths = config('l5-swagger.paths.annotations'); |
|
31
|
|
- if (! is_array($swaggerScanPaths)) { |
|
|
31
|
+ if (!is_array($swaggerScanPaths)) { |
|
32
|
32
|
$swaggerScanPaths = [$swaggerScanPaths]; |
|
33
|
33
|
} |
|
34
|
|
- if (! in_array(base_path('routes'), $swaggerScanPaths)) { |
|
|
34
|
+ if (!in_array(base_path('routes'), $swaggerScanPaths)) { |
|
35
|
35
|
$swaggerScanPaths[] = base_path('routes'); |
|
36
|
36
|
} |
|
37
|
|
- if (! in_array(__DIR__.'/../routes/', $swaggerScanPaths)) { |
|
|
37
|
+ if (!in_array(__DIR__.'/../routes/', $swaggerScanPaths)) { |
|
38
|
38
|
$swaggerScanPaths[] = __DIR__.'/../routes/'; |
|
39
|
39
|
} |
|
40
|
40
|
config(['l5-swagger.paths.annotations' => $swaggerScanPaths]); |
|
@@ -64,7 +64,7 @@ discard block |
|
|
block discarded – undo |
|
64
|
64
|
{ |
|
65
|
65
|
// If the routes files for the swagger oauth config is NOT present, and we have all the right info, then generate it really quick |
|
66
|
66
|
$swaggerAzureadFile = __DIR__.'/../routes/swagger.azuread.php'; |
|
67
|
|
- if (! file_exists($swaggerAzureadFile)) { |
|
|
67
|
+ if (!file_exists($swaggerAzureadFile)) { |
|
68
|
68
|
$aad = new AzureActiveDirectory(config('enterpriseauth.credentials.tenant')); |
|
69
|
69
|
//$authorizationUrl = $aad->authorizationEndpoint . '?resource=https://graph.microsoft.com'; |
|
70
|
70
|
$authorizationUrl = $aad->authorizationEndpoint; |