|
@@ -47,7 +47,7 @@ discard block |
|
|
block discarded – undo |
|
47
|
47
|
// Go through all the credential config and make sure they are set in the .env or config file |
|
48
|
48
|
foreach (config('enterpriseauth.credentials') as $config => $env) { |
|
49
|
49
|
// If one isnt set, throw a red flat until the person fixes it |
|
50
|
|
- if (! config('enterpriseauth.credentials.'.$config)) { |
|
|
50
|
+ if (!config('enterpriseauth.credentials.'.$config)) { |
|
51
|
51
|
throw new \Exception('enterpriseauth setup error: missing mandatory config value for enterpriseauth.credentials.'.$config.' check your .env file!'); |
|
52
|
52
|
} |
|
53
|
53
|
} |
|
@@ -59,7 +59,7 @@ discard block |
|
|
block discarded – undo |
|
59
|
59
|
// Override the application configuration to use our oauth token guard driver at runtime |
|
60
|
60
|
config(['auth.guards.api.driver' => 'oauthtoken']); |
|
61
|
61
|
// Now I have a machine gun. ho ho ho! |
|
62
|
|
- \Illuminate\Support\Facades\Auth::extend('oauthtoken', function ($app, $name, array $config) { |
|
|
62
|
+ \Illuminate\Support\Facades\Auth::extend('oauthtoken', function($app, $name, array $config) { |
|
63
|
63
|
$userProvider = \Illuminate\Support\Facades\Auth::createUserProvider($config['provider']); |
|
64
|
64
|
|
|
65
|
65
|
return new \Metaclassing\EnterpriseAuth\Middleware\OauthTokenGuard($userProvider, $app->make('request')); |
|
@@ -69,13 +69,13 @@ discard block |
|
|
block discarded – undo |
|
69
|
69
|
protected function configureSwaggerToScanEnterpriseAuthRouteFiles() |
|
70
|
70
|
{ |
|
71
|
71
|
$swaggerScanPaths = config('l5-swagger.paths.annotations'); |
|
72
|
|
- if (! is_array($swaggerScanPaths)) { |
|
|
72
|
+ if (!is_array($swaggerScanPaths)) { |
|
73
|
73
|
$swaggerScanPaths = [$swaggerScanPaths]; |
|
74
|
74
|
} |
|
75
|
|
- if (! in_array(base_path('routes'), $swaggerScanPaths)) { |
|
|
75
|
+ if (!in_array(base_path('routes'), $swaggerScanPaths)) { |
|
76
|
76
|
$swaggerScanPaths[] = base_path('routes'); |
|
77
|
77
|
} |
|
78
|
|
- if (! in_array(__DIR__.'/../routes/', $swaggerScanPaths)) { |
|
|
78
|
+ if (!in_array(__DIR__.'/../routes/', $swaggerScanPaths)) { |
|
79
|
79
|
$swaggerScanPaths[] = __DIR__.'/../routes/'; |
|
80
|
80
|
} |
|
81
|
81
|
config(['l5-swagger.paths.annotations' => $swaggerScanPaths]); |
|
@@ -85,7 +85,7 @@ discard block |
|
|
block discarded – undo |
|
85
|
85
|
{ |
|
86
|
86
|
// If the routes files for the swagger oauth config is NOT present, and we have all the right info, then generate it really quick |
|
87
|
87
|
$swaggerAzureadFile = __DIR__.'/../routes/swagger.azuread.php'; |
|
88
|
|
- if (! file_exists($swaggerAzureadFile)) { |
|
|
88
|
+ if (!file_exists($swaggerAzureadFile)) { |
|
89
|
89
|
$aad = new AzureActiveDirectory(config('enterpriseauth.credentials.tenant')); |
|
90
|
90
|
//$authorizationUrl = $aad->authorizationEndpoint . '?resource=https://graph.microsoft.com'; |
|
91
|
91
|
$authorizationUrl = $aad->authorizationEndpoint; |