@@ -78,7 +78,7 @@ public function testNonceAndStateAreSetInCache(): void
78
78
79
79
$ response
80
80
->assertStatus (302 )
81
- ->assertRedirectContains ("https://provider.rdobeheer.nl /authorize " )
81
+ ->assertRedirectContains ("https://provider.example.com /authorize " )
82
82
->assertRedirectContains ('response_type=code ' )
83
83
->assertRedirectContains ('redirect_uri=http%3A%2F%2Flocalhost%2Foidc%2Flogin ' )
84
84
->assertRedirectContains ('client_id=test-client-id ' )
@@ -108,7 +108,7 @@ public function testCodeChallengeIsSetWhenSupported(
108
108
109
109
$ response
110
110
->assertStatus (302 )
111
- ->assertRedirectContains ("https://provider.rdobeheer.nl /authorize " );
111
+ ->assertRedirectContains ("https://provider.example.com /authorize " );
112
112
113
113
if ($ codeChallengeShouldBeSet ) {
114
114
$ response
@@ -137,7 +137,7 @@ public function testStateDoesNotMatch(): void
137
137
// Token requested by OpenIDConnectClient::authenticate() function.
138
138
// Currently needed because the package requests the token endpoint before checking the state.
139
139
// TODO: Remove if https://github.com/jumbojett/OpenID-Connect-PHP/pull/447 is merged.
140
- 'https://provider.rdobeheer.nl /token ' => Http::response ([
140
+ 'https://provider.example.com /token ' => Http::response ([
141
141
'access_token ' => 'access-token-from-token-endpoint ' ,
142
142
'id_token ' => 'some-valid-token-not-needed-for-this-state-check ' ,
143
143
'token_type ' => 'Bearer ' ,
@@ -147,7 +147,7 @@ public function testStateDoesNotMatch(): void
147
147
148
148
// Set OIDC config
149
149
$ this ->mockOpenIDConfigurationLoader ();
150
- Config::set ('oidc.issuer ' , 'https://provider.rdobeheer.nl ' );
150
+ Config::set ('oidc.issuer ' , 'https://provider.example.com ' );
151
151
Config::set ('oidc.client_id ' , 'test-client-id ' );
152
152
Config::set ('oidc.client_secret ' , 'the-secret-client-secret ' );
153
153
@@ -172,29 +172,29 @@ public function testStateDoesNotMatch(): void
172
172
public function testIdTokenSignedWithClientSecret (): void
173
173
{
174
174
$ idToken = generateJwt ([
175
- "iss " => "https://provider.rdobeheer.nl " ,
175
+ "iss " => "https://provider.example.com " ,
176
176
"aud " => 'test-client-id ' ,
177
177
"sub " => 'test-subject ' ,
178
178
], 'the-secret-client-secret ' );
179
179
180
180
Http::fake ([
181
181
// Token requested by OpenIDConnectClient::authenticate() function.
182
- 'https://provider.rdobeheer.nl /token ' => Http::response ([
182
+ 'https://provider.example.com /token ' => Http::response ([
183
183
'access_token ' => 'access-token-from-token-endpoint ' ,
184
184
'id_token ' => $ idToken ,
185
185
'token_type ' => 'Bearer ' ,
186
186
'expires_in ' => 3600 ,
187
187
]),
188
188
// User info requested by OpenIDConnectClient::requestUserInfo() function.
189
- 'https://provider.rdobeheer.nl /userinfo?schema=openid ' => Http::response ([
190
- 'email ' => 'tester@rdobeheer.nl ' ,
189
+ 'https://provider.example.com /userinfo?schema=openid ' => Http::response ([
190
+ 'email ' => 'tester@example.com ' ,
191
191
]),
192
192
]);
193
193
194
194
// Set OIDC config
195
195
$ this ->mockOpenIDConfigurationLoader ();
196
196
197
- Config::set ('oidc.issuer ' , 'https://provider.rdobeheer.nl ' );
197
+ Config::set ('oidc.issuer ' , 'https://provider.example.com ' );
198
198
Config::set ('oidc.client_id ' , 'test-client-id ' );
199
199
Config::set ('oidc.client_secret ' , 'the-secret-client-secret ' );
200
200
@@ -207,7 +207,7 @@ public function testIdTokenSignedWithClientSecret(): void
207
207
$ response ->assertStatus (200 );
208
208
$ response ->assertJson ([
209
209
'userInfo ' => [
210
- 'email ' => 'tester@rdobeheer.nl ' ,
210
+ 'email ' => 'tester@example.com ' ,
211
211
]
212
212
]);
213
213
@@ -216,11 +216,11 @@ public function testIdTokenSignedWithClientSecret(): void
216
216
217
217
Http::assertSentCount (2 );
218
218
Http::assertSentInOrder ([
219
- 'https://provider.rdobeheer.nl /token ' ,
220
- 'https://provider.rdobeheer.nl /userinfo?schema=openid ' ,
219
+ 'https://provider.example.com /token ' ,
220
+ 'https://provider.example.com /userinfo?schema=openid ' ,
221
221
]);
222
222
Http::assertSent (function (Request $ request ) {
223
- if ($ request ->url () === 'https://provider.rdobeheer.nl /token ' ) {
223
+ if ($ request ->url () === 'https://provider.example.com /token ' ) {
224
224
$ this ->assertSame (
225
225
expected: 'POST ' ,
226
226
actual: $ request ->method (),
@@ -236,7 +236,7 @@ public function testIdTokenSignedWithClientSecret(): void
236
236
return true ;
237
237
}
238
238
239
- if ($ request ->url () === 'https://provider.rdobeheer.nl /userinfo?schema=openid ' ) {
239
+ if ($ request ->url () === 'https://provider.example.com /userinfo?schema=openid ' ) {
240
240
$ this ->assertSame (
241
241
expected: 'GET ' ,
242
242
actual: $ request ->method (),
@@ -256,14 +256,14 @@ public function testIdTokenSignedWithClientSecret(): void
256
256
public function testIdTokenSignedWithIncorrectClientSecret (): void
257
257
{
258
258
$ idToken = generateJwt ([
259
- "iss " => "https://provider.rdobeheer.nl " ,
259
+ "iss " => "https://provider.example.com " ,
260
260
"aud " => 'test-client-id ' ,
261
261
"sub " => 'test-subject ' ,
262
262
], 'not-the-secret-client-secret ' );
263
263
264
264
Http::fake ([
265
265
// Token requested by OpenIDConnectClient::authenticate() function.
266
- 'https://provider.rdobeheer.nl /token ' => Http::response ([
266
+ 'https://provider.example.com /token ' => Http::response ([
267
267
'access_token ' => 'access-token-from-token-endpoint ' ,
268
268
'id_token ' => $ idToken ,
269
269
'token_type ' => 'Bearer ' ,
@@ -273,7 +273,7 @@ public function testIdTokenSignedWithIncorrectClientSecret(): void
273
273
274
274
// Set OIDC config
275
275
$ this ->mockOpenIDConfigurationLoader ();
276
- Config::set ('oidc.issuer ' , 'https://provider.rdobeheer.nl ' );
276
+ Config::set ('oidc.issuer ' , 'https://provider.example.com ' );
277
277
Config::set ('oidc.client_id ' , 'test-client-id ' );
278
278
Config::set ('oidc.client_secret ' , 'the-secret-client-secret ' );
279
279
@@ -296,10 +296,10 @@ public function testIdTokenSignedWithIncorrectClientSecret(): void
296
296
297
297
Http::assertSentCount (1 );
298
298
Http::assertSentInOrder ([
299
- 'https://provider.rdobeheer.nl /token ' ,
299
+ 'https://provider.example.com /token ' ,
300
300
]);
301
301
Http::assertSent (function (Request $ request ) {
302
- if ($ request ->url () === 'https://provider.rdobeheer.nl /token ' ) {
302
+ if ($ request ->url () === 'https://provider.example.com /token ' ) {
303
303
$ this ->assertSame (
304
304
expected: 'POST ' ,
305
305
actual: $ request ->method (),
@@ -321,28 +321,28 @@ public function testIdTokenSignedWithIncorrectClientSecret(): void
321
321
public function testIdTokenAndUserinfoSignedWithClientSecret (): void
322
322
{
323
323
$ idToken = generateJwt ([
324
- "iss " => "https://provider.rdobeheer.nl " ,
324
+ "iss " => "https://provider.example.com " ,
325
325
"aud " => 'test-client-id ' ,
326
326
"sub " => 'test-subject ' ,
327
327
], 'the-secret-client-secret ' );
328
328
329
329
$ signedUserInfo = generateJwt ([
330
- "iss " => "https://provider.rdobeheer.nl " ,
330
+ "iss " => "https://provider.example.com " ,
331
331
"aud " => 'test-client-id ' ,
332
332
"sub " => 'test-subject ' ,
333
- "email " => 'tester@rdobeheer.nl ' ,
333
+ "email " => 'tester@example.com ' ,
334
334
], 'the-secret-client-secret ' );
335
335
336
336
Http::fake ([
337
337
// Token requested by OpenIDConnectClient::authenticate() function.
338
- 'https://provider.rdobeheer.nl /token ' => Http::response ([
338
+ 'https://provider.example.com /token ' => Http::response ([
339
339
'access_token ' => 'access-token-from-token-endpoint ' ,
340
340
'id_token ' => $ idToken ,
341
341
'token_type ' => 'Bearer ' ,
342
342
'expires_in ' => 3600 ,
343
343
]),
344
344
// User info requested by OpenIDConnectClient::requestUserInfo() function.
345
- 'https://provider.rdobeheer.nl /userinfo?schema=openid ' => Http::response (
345
+ 'https://provider.example.com /userinfo?schema=openid ' => Http::response (
346
346
body: $ signedUserInfo ,
347
347
status: 200 ,
348
348
headers: [
@@ -354,7 +354,7 @@ public function testIdTokenAndUserinfoSignedWithClientSecret(): void
354
354
// Set OIDC config
355
355
$ this ->mockOpenIDConfigurationLoader ();
356
356
357
- Config::set ('oidc.issuer ' , 'https://provider.rdobeheer.nl ' );
357
+ Config::set ('oidc.issuer ' , 'https://provider.example.com ' );
358
358
Config::set ('oidc.client_id ' , 'test-client-id ' );
359
359
Config::set ('oidc.client_secret ' , 'the-secret-client-secret ' );
360
360
@@ -367,7 +367,7 @@ public function testIdTokenAndUserinfoSignedWithClientSecret(): void
367
367
$ response ->assertStatus (200 );
368
368
$ response ->assertJson ([
369
369
'userInfo ' => [
370
- 'email ' => 'tester@rdobeheer.nl ' ,
370
+ 'email ' => 'tester@example.com ' ,
371
371
]
372
372
]);
373
373
@@ -376,11 +376,11 @@ public function testIdTokenAndUserinfoSignedWithClientSecret(): void
376
376
377
377
Http::assertSentCount (2 );
378
378
Http::assertSentInOrder ([
379
- 'https://provider.rdobeheer.nl /token ' ,
380
- 'https://provider.rdobeheer.nl /userinfo?schema=openid ' ,
379
+ 'https://provider.example.com /token ' ,
380
+ 'https://provider.example.com /userinfo?schema=openid ' ,
381
381
]);
382
382
Http::assertSent (function (Request $ request ) {
383
- if ($ request ->url () === 'https://provider.rdobeheer.nl /token ' ) {
383
+ if ($ request ->url () === 'https://provider.example.com /token ' ) {
384
384
$ this ->assertSame (
385
385
expected: 'POST ' ,
386
386
actual: $ request ->method (),
@@ -396,7 +396,7 @@ public function testIdTokenAndUserinfoSignedWithClientSecret(): void
396
396
return true ;
397
397
}
398
398
399
- if ($ request ->url () === 'https://provider.rdobeheer.nl /userinfo?schema=openid ' ) {
399
+ if ($ request ->url () === 'https://provider.example.com /userinfo?schema=openid ' ) {
400
400
$ this ->assertSame (
401
401
expected: 'GET ' ,
402
402
actual: $ request ->method (),
@@ -416,28 +416,28 @@ public function testIdTokenAndUserinfoSignedWithClientSecret(): void
416
416
public function testSubClaimIdTokenDoesNotEqualsSubClaimUserinfo (): void
417
417
{
418
418
$ idToken = generateJwt ([
419
- "iss " => "https://provider.rdobeheer.nl " ,
419
+ "iss " => "https://provider.example.com " ,
420
420
"aud " => 'test-client-id ' ,
421
421
"sub " => 'test-subject ' ,
422
422
], 'the-secret-client-secret ' );
423
423
424
424
$ signedUserInfo = generateJwt ([
425
- "iss " => "https://provider.rdobeheer.nl " ,
425
+ "iss " => "https://provider.example.com " ,
426
426
"aud " => 'test-client-id ' ,
427
427
"sub " => 'different-subject ' ,
428
- "email " => 'tester@rdobeheer.nl ' ,
428
+ "email " => 'tester@example.com ' ,
429
429
], 'the-secret-client-secret ' );
430
430
431
431
Http::fake ([
432
432
// Token requested by OpenIDConnectClient::authenticate() function.
433
- 'https://provider.rdobeheer.nl /token ' => Http::response ([
433
+ 'https://provider.example.com /token ' => Http::response ([
434
434
'access_token ' => 'access-token-from-token-endpoint ' ,
435
435
'id_token ' => $ idToken ,
436
436
'token_type ' => 'Bearer ' ,
437
437
'expires_in ' => 3600 ,
438
438
]),
439
439
// User info requested by OpenIDConnectClient::requestUserInfo() function.
440
- 'https://provider.rdobeheer.nl /userinfo?schema=openid ' => Http::response (
440
+ 'https://provider.example.com /userinfo?schema=openid ' => Http::response (
441
441
body: $ signedUserInfo ,
442
442
status: 200 ,
443
443
headers: [
@@ -449,7 +449,7 @@ public function testSubClaimIdTokenDoesNotEqualsSubClaimUserinfo(): void
449
449
// Set OIDC config
450
450
$ this ->mockOpenIDConfigurationLoader ();
451
451
452
- Config::set ('oidc.issuer ' , 'https://provider.rdobeheer.nl ' );
452
+ Config::set ('oidc.issuer ' , 'https://provider.example.com ' );
453
453
Config::set ('oidc.client_id ' , 'test-client-id ' );
454
454
Config::set ('oidc.client_secret ' , 'the-secret-client-secret ' );
455
455
@@ -475,11 +475,11 @@ public function testSubClaimIdTokenDoesNotEqualsSubClaimUserinfo(): void
475
475
476
476
Http::assertSentCount (2 );
477
477
Http::assertSentInOrder ([
478
- 'https://provider.rdobeheer.nl /token ' ,
479
- 'https://provider.rdobeheer.nl /userinfo?schema=openid ' ,
478
+ 'https://provider.example.com /token ' ,
479
+ 'https://provider.example.com /userinfo?schema=openid ' ,
480
480
]);
481
481
Http::assertSent (function (Request $ request ) {
482
- if ($ request ->url () === 'https://provider.rdobeheer.nl /token ' ) {
482
+ if ($ request ->url () === 'https://provider.example.com /token ' ) {
483
483
$ this ->assertSame (
484
484
expected: 'POST ' ,
485
485
actual: $ request ->method (),
@@ -495,7 +495,7 @@ public function testSubClaimIdTokenDoesNotEqualsSubClaimUserinfo(): void
495
495
return true ;
496
496
}
497
497
498
- if ($ request ->url () === 'https://provider.rdobeheer.nl /userinfo?schema=openid ' ) {
498
+ if ($ request ->url () === 'https://provider.example.com /userinfo?schema=openid ' ) {
499
499
$ this ->assertSame (
500
500
expected: 'GET ' ,
501
501
actual: $ request ->method (),
@@ -516,7 +516,7 @@ public function testTokenSignedWithPrivateKey(): void
516
516
{
517
517
Http::fake ([
518
518
// Token requested by OpenIDConnectClient::authenticate() function.
519
- 'https://provider.rdobeheer.nl /token ' => Http::response ([
519
+ 'https://provider.example.com /token ' => Http::response ([
520
520
'access_token ' => 'access-token-from-token-endpoint ' ,
521
521
'id_token ' => 'does-not-matter-not-testing-id-token ' ,
522
522
'token_type ' => 'Bearer ' ,
@@ -527,7 +527,7 @@ public function testTokenSignedWithPrivateKey(): void
527
527
// Set OIDC provider configuration
528
528
$ this ->mockOpenIDConfigurationLoader (tokenEndpointAuthMethodsSupported: ['private_key_jwt ' ]);
529
529
530
- Config::set ('oidc.issuer ' , 'https://provider.rdobeheer.nl ' );
530
+ Config::set ('oidc.issuer ' , 'https://provider.example.com ' );
531
531
Config::set ('oidc.client_id ' , 'test-client-id ' );
532
532
533
533
// Set client private key
@@ -547,14 +547,14 @@ public function testTokenSignedWithPrivateKey(): void
547
547
548
548
Http::assertSentCount (1 );
549
549
Http::assertSentInOrder ([
550
- 'https://provider.rdobeheer.nl /token ' ,
550
+ 'https://provider.example.com /token ' ,
551
551
]);
552
552
Http::assertSent (function (Request $ request ) {
553
- if (!in_array ($ request ->url (), ['https://provider.rdobeheer.nl /token ' ], true )) {
553
+ if (!in_array ($ request ->url (), ['https://provider.example.com /token ' ], true )) {
554
554
return false ;
555
555
}
556
556
557
- if ($ request ->url () === 'https://provider.rdobeheer.nl /token ' ) {
557
+ if ($ request ->url () === 'https://provider.example.com /token ' ) {
558
558
$ this ->assertSame (
559
559
expected: 'POST ' ,
560
560
actual: $ request ->method (),
@@ -610,16 +610,16 @@ protected function exampleOpenIDConfiguration(
610
610
frontchannelLogoutSessionSupported: false ,
611
611
backchannelLogoutSupported: false ,
612
612
backchannelLogoutSessionSupported: false ,
613
- issuer: "https://provider.rdobeheer.nl " ,
614
- authorizationEndpoint: "https://provider.rdobeheer.nl /authorize " ,
615
- jwksUri: "https://provider.rdobeheer.nl /jwks " ,
616
- tokenEndpoint: "https://provider.rdobeheer.nl /token " ,
613
+ issuer: "https://provider.example.com " ,
614
+ authorizationEndpoint: "https://provider.example.com /authorize " ,
615
+ jwksUri: "https://provider.example.com /jwks " ,
616
+ tokenEndpoint: "https://provider.example.com /token " ,
617
617
scopesSupported: ["openid " ],
618
618
responseTypesSupported: ["code " ],
619
619
responseModesSupported: ["query " ],
620
620
subjectTypesSupported: ["pairwise " ],
621
621
idTokenSigningAlgValuesSupported: ["RS256 " ],
622
- userinfoEndpoint: "https://provider.rdobeheer.nl /userinfo " ,
622
+ userinfoEndpoint: "https://provider.example.com /userinfo " ,
623
623
codeChallengeMethodsSupported: $ codeChallengeMethodsSupported ,
624
624
);
625
625
}
0 commit comments