@@ -103,8 +103,26 @@ groups() ->
103
103
{with_oauth_enabled , [], [
104
104
{with_mgt_oauth_client_id_z , [], [
105
105
should_not_return_end_session_endpoint ,
106
- {with_end_session_endpoint , [], [
107
- should_return_end_session_endpoint
106
+ {with_root_end_session_endpoint_0 , [], [
107
+ should_return_end_session_endpoint_0
108
+ ]}
109
+ ]}
110
+ ]}
111
+ ]},
112
+ {with_oauth_providers_idp1_idp2 , [], [
113
+ {with_default_oauth_provider_idp1 , [], [
114
+ {with_oauth_enabled , [], [
115
+ {with_mgt_oauth_client_id_z , [], [
116
+ should_not_return_end_session_endpoint ,
117
+ {with_end_session_endpoint_for_idp1_1 , [], [
118
+ should_return_end_session_endpoint_1
119
+ ]},
120
+ {with_root_end_session_endpoint_0 , [], [
121
+ should_not_return_end_session_endpoint ,
122
+ {with_end_session_endpoint_for_idp1_1 , [], [
123
+ should_return_end_session_endpoint_1
124
+ ]}
125
+ ]}
108
126
]}
109
127
]}
110
128
]}
@@ -252,7 +270,8 @@ init_per_suite(Config) ->
252
270
{idp3_url , <<" https://idp3" >>},
253
271
{url0 , <<" https://url0" >>},
254
272
{url1 , <<" https://url1" >>},
255
- {logout_url , <<" https://logoug" >>},
273
+ {logout_url_0 , <<" https://logout_0" >>},
274
+ {logout_url_1 , <<" https://logout_1" >>},
256
275
{a , <<" a" >>},
257
276
{b , <<" b" >>},
258
277
{q , <<" q" >>},
@@ -345,8 +364,12 @@ init_per_group(with_default_oauth_provider_idp1, Config) ->
345
364
init_per_group (with_default_oauth_provider_idp3 , Config ) ->
346
365
application :set_env (rabbitmq_auth_backend_oauth2 , default_oauth_provider , ? config (idp3 , Config )),
347
366
Config ;
348
- init_per_group (with_end_session_endpoint , Config ) ->
349
- application :set_env (rabbitmq_auth_backend_oauth2 , end_session_endpoint , ? config (logout_url , Config )),
367
+ init_per_group (with_root_end_session_endpoint_0 , Config ) ->
368
+ application :set_env (rabbitmq_auth_backend_oauth2 , end_session_endpoint , ? config (logout_url_0 , Config )),
369
+ Config ;
370
+ init_per_group (with_end_session_endpoint_for_idp1_1 , Config ) ->
371
+ set_attribute_in_entry_for_env_variable (rabbitmq_auth_backend_oauth2 , oauth_providers ,
372
+ ? config (idp1 , Config ), end_session_endpoint , ? config (logout_url_1 , Config )),
350
373
Config ;
351
374
352
375
init_per_group (_ , Config ) ->
@@ -429,9 +452,13 @@ end_per_group(with_default_oauth_provider_idp1, Config) ->
429
452
end_per_group (with_default_oauth_provider_idp3 , Config ) ->
430
453
application :unset_env (rabbitmq_auth_backend_oauth2 , default_oauth_provider ),
431
454
Config ;
432
- end_per_group (with_end_session_endpoint , Config ) ->
455
+ end_per_group (with_root_end_session_endpoint_0 , Config ) ->
433
456
application :unset_env (rabbitmq_auth_backend_oauth2 , end_session_endpoint ),
434
457
Config ;
458
+ end_per_group (with_end_session_endpoint_for_idp1_1 , Config ) ->
459
+ remove_attribute_from_entry_from_env_variable (rabbitmq_auth_backend_oauth2 , oauth_providers ,
460
+ ? config (idp1 , Config ), end_session_endpoint ),
461
+ Config ;
435
462
end_per_group (_ , Config ) ->
436
463
Config .
437
464
@@ -561,10 +588,15 @@ should_not_return_end_session_endpoint(Config) ->
561
588
assert_attribute_not_defined_for_oauth_resource_server (rabbit_mgmt_wm_auth :authSettings (),
562
589
Config , rabbit , end_session_endpoint ).
563
590
564
- should_return_end_session_endpoint (Config ) ->
591
+ should_return_end_session_endpoint_0 (Config ) ->
592
+ ct :log (" settings: ~p " , [rabbit_mgmt_wm_auth :authSettings ()]),
593
+ assertEqual_on_attribute_for_oauth_resource_server (rabbit_mgmt_wm_auth :authSettings (),
594
+ Config , rabbit , end_session_endpoint , ? config (logout_url_0 , Config )).
595
+
596
+ should_return_end_session_endpoint_1 (Config ) ->
565
597
ct :log (" settings: ~p " , [rabbit_mgmt_wm_auth :authSettings ()]),
566
598
assertEqual_on_attribute_for_oauth_resource_server (rabbit_mgmt_wm_auth :authSettings (),
567
- Config , rabbit , end_session_endpoint , logout_url ).
599
+ Config , rabbit , end_session_endpoint , ? config ( logout_url_1 , Config ) ).
568
600
569
601
570
602
% % -------------------------------------------------------------------
0 commit comments