File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -527,6 +527,10 @@ private function validateStateApi(): void
527
527
*/
528
528
private function validateStateManagement (): void
529
529
{
530
+ if (! $ this ->hasDomain ()) {
531
+ throw \Auth0 \SDK \Exception \ConfigurationException::requiresDomain ();
532
+ }
533
+
530
534
if (! $ this ->hasManagementToken ()) {
531
535
if (! $ this ->hasClientId ()) {
532
536
throw \Auth0 \SDK \Exception \ConfigurationException::requiresClientId ();
Original file line number Diff line number Diff line change 232
232
]);
233
233
})->throws (\Auth0 \SDK \Exception \ConfigurationException::class, \Auth0 \SDK \Exception \ConfigurationException::MSG_REQUIRES_AUDIENCE );
234
234
235
- test ('a `management` strategy requires a client id if a management token is not provided ' , function (): void
235
+ test ('a `management` strategy requires a domain ' , function (): void
236
236
{
237
237
$ sdk = new SdkConfiguration ([
238
238
'strategy ' => 'management '
239
239
]);
240
+ })->throws (\Auth0 \SDK \Exception \ConfigurationException::class, \Auth0 \SDK \Exception \ConfigurationException::MSG_REQUIRES_DOMAIN );
241
+
242
+ test ('a `management` strategy requires a client id if a management token is not provided ' , function (): void
243
+ {
244
+ $ sdk = new SdkConfiguration ([
245
+ 'strategy ' => 'management ' ,
246
+ 'domain ' => uniqid ()
247
+ ]);
240
248
})->throws (\Auth0 \SDK \Exception \ConfigurationException::class, \Auth0 \SDK \Exception \ConfigurationException::MSG_REQUIRES_CLIENT_ID );
241
249
242
250
test ('a `management` strategy requires a client secret if a management token is not provided ' , function (): void
243
251
{
244
252
$ sdk = new SdkConfiguration ([
245
253
'strategy ' => 'management ' ,
254
+ 'domain ' => uniqid (),
246
255
'clientId ' => uniqid ()
247
256
]);
248
257
})->throws (\Auth0 \SDK \Exception \ConfigurationException::class, \Auth0 \SDK \Exception \ConfigurationException::MSG_REQUIRES_CLIENT_SECRET );
251
260
{
252
261
$ sdk = new SdkConfiguration ([
253
262
'strategy ' => 'management ' ,
263
+ 'domain ' => uniqid (),
254
264
'managementToken ' => uniqid ()
255
265
]);
256
266
You can’t perform that action at this time.
0 commit comments