@@ -35,7 +35,7 @@ |
||
35 | 35 | if ($tenantName != 'common') { |
36 | 36 | // Make sure the tenant is formatted like xyzcorp.onmicrosoft.com |
37 | 37 | $regex = '/\.onmicrosoft\.com/'; |
38 | - if (! preg_match($regex, $tenantName, $hits)) { |
|
38 | + if (!preg_match($regex, $tenantName, $hits)) { |
|
39 | 39 | // Append the suffix if it is missing |
40 | 40 | $tenantName .= '.onmicrosoft.com'; |
41 | 41 | } |
@@ -134,8 +134,8 @@ |
||
134 | 134 | } |
135 | 135 | // Get the X509 certificate for the selected key id |
136 | 136 | $certificate = '-----BEGIN CERTIFICATE-----'.PHP_EOL |
137 | - .$x5c.PHP_EOL |
|
138 | - .'-----END CERTIFICATE-----'; |
|
137 | + .$x5c.PHP_EOL |
|
138 | + .'-----END CERTIFICATE-----'; |
|
139 | 139 | // Perform the verification and get the verified payload results |
140 | 140 | $payload = \Firebase\JWT\JWT::decode($accessToken, $certificate, ['RS256']); |
141 | 141 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $app_id = $appData->azp; |
99 | 99 | $app = \Metaclassing\EnterpriseAuth\Models\AzureApp::where('app_id', $app_id)->first(); |
100 | 100 | // If we dont have an existing app go create one |
101 | - if (! $app) { |
|
101 | + if (!$app) { |
|
102 | 102 | $app = \Metaclassing\EnterpriseAuth\Models\AzureApp::create(); |
103 | 103 | $app->name = $app_id; |
104 | 104 | $app->app_id = $app_id; |
@@ -114,16 +114,16 @@ discard block |
||
114 | 114 | // Unpack our jwt to verify it is correctly formed |
115 | 115 | $token = $this->unpackJwt($accessToken); |
116 | 116 | // app tokens must be signed in RSA |
117 | - if (! isset($token['header']['alg']) || $token['header']['alg'] != 'RS256') { |
|
117 | + if (!isset($token['header']['alg']) || $token['header']['alg'] != 'RS256') { |
|
118 | 118 | throw new \Exception('Token is not using the correct signing algorithm RS256 '.$accessToken); |
119 | 119 | } |
120 | 120 | // app tokens are RSA signed with a key ID in the header of the token |
121 | - if (! isset($token['header']['kid'])) { |
|
121 | + if (!isset($token['header']['kid'])) { |
|
122 | 122 | throw new \Exception('Token with unknown RSA key id can not be validated '.$accessToken); |
123 | 123 | } |
124 | 124 | // Make sure the key id is known to our azure ad information |
125 | 125 | $kid = $token['header']['kid']; |
126 | - if (! isset($this->azureActiveDirectory->signingKeys[$kid])) { |
|
126 | + if (!isset($this->azureActiveDirectory->signingKeys[$kid])) { |
|
127 | 127 | throw new \Exception('Token signed with unknown KID '.$kid); |
128 | 128 | } |
129 | 129 | // get the x509 encoded cert body |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $roles = $user->roles()->get()->all(); |
201 | 201 | foreach ($roles as $key => $role) { |
202 | 202 | $role->permissions = $role->abilities()->get()->all(); |
203 | - if (! count($role->permissions)) { |
|
203 | + if (!count($role->permissions)) { |
|
204 | 204 | unset($roles[$key]); |
205 | 205 | } |
206 | 206 | } |